Warm tip: This article is reproduced from stackoverflow.com, please click
google-calendar-api

Did Google Calendar change the way shared calendars are added to your account by needing you to clic

发布于 2020-03-27 15:40:32

I use the Google Calendar API to read from shared Google Calendars. Until recently when someone shared a calendar with me I would get an email that said the following...

Hello name@gmail.com,

We are writing to let you know that someuser@gmail.com has given you access to view events on the Google Calendar called "someuser@gmail.com".

We have automatically added this calendar to your Google Calendar account. You can hide or completely remove this calendar at any time.

  • The Google Calendar Team View Your Calendar.

Now it seems I need to actually accept and add the calendar before I can see it in my list. Here is what the last few emails look like...

Hello name@gmail.com,

We are writing to let you know that someuser@gmail.com has given you access to view events on the Google Calendar called "My Calendar".

After adding this calendar to your other calendars, you can hide or completely remove it whenever you want.

Add this calendar.

  • The Google Calendar Team View Your Calendar.

So I have to actually open the email and click on the "Add this calendar" link before I can see it. Anyone know of any changes or differences in some calendars vs others that would make me do this? I need the process to be automatic, so this is a bit of a burden. Thanks!

Questioner
Zenacity
Viewed
26
ziganotschka 2020-01-31 16:15

As already mentioned the way to share a calendar with users recently changed

Now, after sharing the calendar the user has to manually add the calendar into his calendar list.

The necessary method is CalendarList: insert

If you are using a service account with domain-wide delegation, you can impersonate the user and let the service account add the calendar to the list on the user's behalf.

You did not mention which language your areusing. Please see here for sample of how to implement the insert request in different programming languages.