Google Calendar API - Fetching Group calendars

I’m currently working on writing a sync application to migrate Group calendars from Google G Suite to MS O365, and after reading up on a lot of APIs etc, I thought I’d post a short summary of my findings below.

Unfortunately, Google’s Calendar API isn’t as flexible as I’d like it to be, so this is a much more complex process than it arguably should be.

The following are some caveats/“gotchas” that I’ve come across so far.

API caveats

Group caveats

Based on this, to be able to get a list of unique shared calendars within an organisation, you’d need to:

  1. Create an array or Hash map to be used to track the shared calendars within an organisation.
  2. Get a list of users.
  3. For each of the users
    • Get all calendar lists for this user,
    • Filter the calendar lists by those with ids ending with,
    • Add these into the aforementioned array or Hash map.