Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access other users calendars with google calendar v3?

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.

like image 900
user1643047 Avatar asked Nov 13 '12 10:11

user1643047


People also ask

How do I view other people's calendars on Google Calendar?

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.

Why can't I see a shared calendar on Google 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.


1 Answers

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]"
  }
]
like image 175
hexedpackets Avatar answered Sep 18 '22 12:09

hexedpackets