I am using the Google Calendar (v3) API, with google apps and am wanting to use a single oauth2 credential to determine what users are free/busy at any given point.
I am wanting to use this: https://developers.google.com/google-apps/calendar/v3/reference/freebusy/query
But to use this I need to get all the calendar ids for all the users. I cannot do this as the java client for the google calendar can only retrieve calendars of the user who owns the credential.
Note: I have access to all the users through the provisioning api.
Any help would be much appreciated as I am totally blocked by this.
See someone else's calendarOn your computer, open Google Calendar. On the left click Search for people. Start typing someone's name and choose the person whose calendar you want to see. If their calendar is shared publicly or within your organization, you'll see their events on your calendar.
In the Calendar left sidebar, go to Other calendars. Subscribe to calendar. In the Add calendar box, enter your email address. Your calendar should appear in their list.
For primary calendars, the calendarId is the user's email address. The authenticated user will also need to have permission to access the calendar. If you're using the Provisioning API then I'll assume you are a super admin, and super admins can access every calendar on their domain.
The specific query you are trying to do takes a list of calendarIds to query as a JSON list. If you are only concerned about primary calendars, then set each user's email as an id like this:
"items": [
{
"id": "[email protected]"
},
{
"id": "[email protected]"
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With