Warm tip: This article is reproduced from serverfault.com, please click

Access entire gsuite domain calendar events

发布于 2021-01-05 10:11:03

I want to access the entire events existing in a calendar of a gsuite domain. I tried using domain deligation with service account and it allows me to assume a user and get all of its events but i want to fetch the entire events in a gsuite account.

Questioner
Shailendra Yadav
Viewed
0
ale13 2021-01-12 00:30:19

In order to achieve your task, you should create a service account which impersonates the admin of the domain.

Afterwards, you can retrieve the users of the domain by making use of the Admin SDK.

GET https://admin.googleapis.com/admin/directory/v1/users

Based on the list you get, you can get the events from the calendar of each user.

GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events

Where, calendarId is the email of one of the users from the domain.

Reference