Prerequisites
The connector should already be set up, with a Connector Profile and a Linked Account. See Getting Started on the Google Calendar connector page.Automatic notification channels
StackOne creates and manages the Google Calendar notification channels automatically when the account is connected, and stops them when the account is disconnected. You don’t need to set anything up in Google Calendar or the Google Cloud Console.
Select events in StackOne
Enable the webhook events you want on the Google Calendar connector in StackOne. Google Calendar watches one collection per notification channel, so StackOne creates one channel for each selected event.
Check scope requirements
Each event needs read access to the collection it watches. The connector’s default scope, https://www.googleapis.com/auth/calendar, covers every event. If you set narrower scopes on the StackOne Connector profile, include at least one of these per event:
- Events Changed:
https://www.googleapis.com/auth/calendar.events.readonly,https://www.googleapis.com/auth/calendar.eventsorhttps://www.googleapis.com/auth/calendar.readonly - ACL Changed:
https://www.googleapis.com/auth/calendar.acls.readonlyorhttps://www.googleapis.com/auth/calendar.acls - Calendar List Changed:
https://www.googleapis.com/auth/calendar.calendarlist.readonly,https://www.googleapis.com/auth/calendar.calendarlistorhttps://www.googleapis.com/auth/calendar.readonly - Settings Changed:
https://www.googleapis.com/auth/calendar.settings.readonlyorhttps://www.googleapis.com/auth/calendar.readonly
Reconnect to renew expired channels
Google ends every notification channel 30 days after it is created, and StackOne does not create replacements on its own. When events stop arriving, reconnect the account in StackOne Hub. StackOne stops the old channels and creates new ones for the selected events.
Available webhook events
The following Google Calendar events can be enabled. Only events selected in StackOne get a notification channel, and Google Calendar does not deliver changes for collections that are not watched.
Calendar events
Events on the connected user’s primary calendar.
- Events Changed (
events.changed) — Fired when an event on the user’s primary calendar is created, updated, or deleted - ACL Changed (
acl.changed) — Fired when a sharing rule on the user’s primary calendar is created, updated, or deleted
User events
Events on the connected user’s calendar list and settings.
- Calendar List Changed (
calendarList.changed) — Fired when a calendar is added to, changed in, or removed from the user’s calendar list - Settings Changed (
settings.changed) — Fired when one of the user’s Google Calendar settings changes
Delivery format
Details of how Google Calendar delivers events to StackOne.
Notifications carry no change details
Google Calendar notifications have no body. Each one says only that the watched collection changed; it does not say which item changed or how. Fetch the changes with the matching list action.
- Events Changed: call
list_eventson the primary calendar with asyncToken. - ACL Changed: call
list_aclon the primary calendar. - Calendar List Changed: call
list_calendar_listwith asyncToken. - Settings Changed: call
list_settingswith asyncToken.
Primary calendar only
Events Changed and ACL Changed watch the user’s primary calendar. Changes on secondary or shared calendars are not delivered.
Event payload
Each event’s ID combines the channel ID and Google’s message number (channelId:messageNumber). The event data holds the notification headers: resource state, channel ID, resource ID, resource URI, message number, and the channel’s expiry date.
- Google does not guarantee delivery of every notification, so run a periodic sync as a fallback.