Skip to main content

USEFUL CONCEPTS

Notification Channels

Introduction

Scrims Calendar Notification Channels provide a way for extensions to receive real-time updates about changes to calendar events without continuously polling the Scrims Calendar API. This is achieved using web-hooks, where Scrims sends notifications to a specified endpoint (web-hook) whenever there are changes in the calendar events.

Purpose

The main purpose of Scrims Calendar Notification Channels is to enable applications to synchronize calendar data efficiently and respond promptly to changes such as event creation, updates, or deletions.

Key Concepts

  1. Create a web-hook to receive the updates
  2. Register the web-hook using the scrims API
GET /calendars/${calendarId}/events/watch HTTP/1.1
Host: api.atomcal.com/api/v2
Content-Type: application/x-www-form-urlencoded
Authorization: GhostMembers ACCESS_TOKEN
Triggered by: You

{
   type: "web_hook",
   address: `${baseUrl}/example/webhook`,
   params: {
      ttl: 172800 * 60,
   },
}
  1. Every time the update happens it will trigger this web-hook

Example Payload:

[{
  "kind": "calendar#event",
  "id": "abcdef123456",
  "status": "confirmed",
  "summary": "Team Meeting",
  "description": "Discuss quarterly goals",
  "location": "Conference Room A",
  "start_time": "2024-07-19T09:00:00-07:00",
  "start_timezone": "America/Los_Angeles"
  "end_time": "2024-07-19T10:00:00-07:00",
  "end_timezone": "America/Los_Angeles"
}]

Process the request and update accordingly