Search code examples
google-calendar-api

When Do Resource Watches Expire? | Google Calendar API


What does Google Calendar's API use as a default expiration value for resource watches?


The GCal Node Client uses an expiration of 7 days when I don't pass it my own expiration value. Someone previously stated that the default is 7 days, and the max is 30 (here), but I haven't seen that verified in any official documentation.

Google Calendar API's Push Notification doc says that this expiration value for a resource watch is

determined either by your request or by any Google Calendar API internal limits or defaults (the more restrictive value is used)

...but I haven't found where this "internal limit or defaults" value is officially documented.


I'm looking for a more official answer, because I don't want to have to set an unnecessarily quick expiration or have my sync code break if Gcal changes their default values


Solution

  • As per the documentation on Events Watch:

    params.ttl string The time-to-live in seconds for the notification channel. Default is 604800 seconds.

    And as per Google:

    enter image description here

    NB: The same information can be found for Acl: watch, CalendarList: watch and Settings: watch.