Skip to content
Advertisement

Creating Secondary Calendars In a GSuite Domain

  • I have created a GSuite account with a domain called redu.club
  • I created a project and a service account using GSuite admin email
  • Added that service account to the admin calendar using share settings and have given full manage rights.

I am trying to create secondary calendars under the redu-admin@redu.club account. Here is the code I have:

JavaScript

This code creates a calendar but when I go to the calendar of redu-admin@redu.club, I can’t see it. My guess is it’s creating a calendar under the service account. When I try adding the line $this->client->setSubject('redu-admin@redu.club');, the error I get is:

JavaScript

Any help is greatly appreciated.

Advertisement

Answer

If you want to create a secondary calendar for a user, you need to impersonate this user

You already tried it correctly:

JavaScript

But there two important steps that need to be followed previously:

  1. Enable domain-wide delegation for the service account in the GCP console
  2. Provide the service account the necessary delegation scopes in the Admin console
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement