Watch Google Events
This API endpoint is triggered by the Google calendar service with appropriate headers that enables the processing.
Endpoint
POST /google/events/watch/google HTTP/1.1
Host: api.atomcal.com/api/v2
Content-Type: application/x-www-form-urlencoded
x-goog-resource-state: exists
x-goog-channel-id: notificationChannelId
x-goog-resource-uri: googleCalendarId
Triggered by: Google Calendar API
Authentication: N/A
After hearing any changes and verifying the validity of the request Google calendar events are synchronized using the next sync token.
Example Responses
200 (successful operation)
res.status(200);
400 (bad response)
N/A
Implementation details
- Extract the calendar id from "x-goog-resource-uri" header component
- Match the saved Google notification channel id with passed "x-goog-channel-id" header component
- Synchronize Google calendar events (using the next sync token if found) both locally and to Scrims calendar
Edge cases
Incase the passed header "x-goog-channel-id" does not match with a saved google_notification_channel id, it stops this channel to send any more requests.