WThree Partnership
WThree Partnership

Reputation: 11

Google Calendar event watch api and the 'time to live' maximum duration

Please may I ask if anybody can confirm that the maximum time to live when setting up push notifications using the calendar events watch api looks to be only a month?

Calling this end point: https://www.googleapis.com/calendar/v3/calendars/[email protected]/events/watch

with this payload:

{
  "id": "blah-014",
  "token": "11223344",
  "type": "web_hook",
  "address": "https://blah.com/NotificationsFromGoogle_v1",
  "params": {
    "ttl": "157680000"
  }
}

Regardless of how large a number the ttl value is (greater than a month) I always get back a response with

"expiration": nnnnnnnnn, // Actual expiration time as Unix timestamp (in ms), if applicable.

set to a maximum of month ahead.

Upvotes: 1

Views: 1069

Answers (1)

Jose Vasquez
Jose Vasquez

Reputation: 1728

The limit expiration for a notification channel is 30 days. Therefore after that time you can renew your notification channel as needed (currently there's no way to renew automatically this channel as mentioned here). However if for some reason you want to stop a notification channel you should take a look to the considerations

Reference

Renewing notification channels

Stopping notifications

Upvotes: 4

Related Questions