This guide assumes you've already done the following:
A calendar integration can consist of multiple distinct calendars.
An example Gmail integration consists of a primary
calendar (named for the account email address) as well as many additional calendars, such as Public Holidays, Work, Personal, Training Schedule, etc.
All events belong to a calendar and contain a reference to it, either when being retrieved or being created.
See calendar model in the reference.
A call to list calendars will, by default, return all calendars for all connected calendar accounts.
WorkAPI does not attempt to merge calendars together, instead returning each as a separate entity. Requests to list events can then be filtered by one or more calendar IDs as required.
token = "<user's token>"
client = LivilApi::Service.new(token)
mailboxes = client.list_calendars
mailboxes
# => [LivilApi::Calendar(id: '...', name: 'My Awesome Calendar', description: '...', ...), LivilApi::Calendar(id: '...', name: 'Holidays in United Kingdom', description: '...', ...), ...]