Eric Ruder
Eric Ruder

Reputation: 535

Discovering CalendarID's in Google Calendar API

I am currently working on a project, where I have to synchronize an internal calendar with all google calendars that belong to a certain domain, and that are shared with that domain.

We have a kind of service user and if I log in as that service user to the google calendar web app, I can search through all the employees' calendars that are shared with our companies domain and add them.

The problem here is that even though users share their calendar with the domain, I cannot search for that calendar through the API and add that to the calendar list I am interested in.

The only way for that user's calendar to be shown in the calendar list of the service user is to either have the calendar ID delivered from the user we are fetching the events from (either manually from the user, or login in on the users behalf and fetching it) or log into the service user in the web app and then add that calendar manually.

I have attached a picture below showing what I am missing. I cannot seem to find anywhere the list of calendars that are shared with a given user from the API. The only way to see those calendars is to add that calendar manually from the Web Client. I would love some help in figuring out how to do this through the API.

Missing List

Upvotes: 1

Views: 461

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116918

There is no way to discover calendar ids.

If you are using a service account and a user shares their calendar with the server account. You are still going to have to add it to the service accounts calendar.list yourself (using the service account) there is no way for it to find calendars that it has access to. It has to be told it has access to this calendar.

In the web version of google calendar if i share a calendar with someone it else it will prop up in their calendar.list becomes it was added by the web version of calendar when the user accepted the share. A service account cant accept the share so its never added.

Upvotes: 1

Related Questions