Watch Scrims Events
This API endpoint is triggered by the Scrims calendar service as a webhook with appropriate headers that enables the processing.
Endpoint
POST /google/events/watch/atomcal HTTP/1.1
Host: api.atomcal.com/api/v2
Content-Type: application/x-www-form-urlencoded
Triggered by: Scrims Calendar API
Authentication: N/A
Query: req.query.calendar_id
Body: ScrimsEvents[]
After hearing any changes and verifying the validity of the request Scrims calendar events are synchronized with associated Google calendar.
Example Responses
200 (successful operation)
res.status(200).send({ success: true });
400 (bad response)
N/A
Implementation details
- Pick the calendar from locally saved calendars list by using the passed Scrims calendar id (which can be picked from dev-tools by any fool)
- Using the events in the body; map through each events and upsert on Google calendar by using the existing Google calendar accounts Auth Token
Edge cases
If eventGoogleCalendar.atomcal_calendar_id is not found it tries to attach the calendar if not already attached; if it is then it throws a bad request.