0

I have a google account with my company domain. I received super user status so that I can access all the calendars in the workspace. I registered my app and followed oAuth2.0 authorization steps with these scopes -

https://www.googleapis.com/auth/calendar.events https://www.googleapis.com/auth/admin.directory.resource.calendar https://www.googleapis.com/auth/calendar

Now I am able to read all the events and subscribe to the web_hook. My doubt is twofold -

  1. For the same user, when I fetch the calendar list using CalendarList.list method (Calendar A), it is different from the list I get when I hit calendar list API from the admin directory side (Calendar B). Is it because there are 2 sets of calendars being maintained for the user side and one from the admin side (that is domain wide)? If so, how can I modify or create an event in calendar B? (it is pretty simple from the UI side, I open my calendar and add that particular room to the meeting).

  2. If there is a meeting (event) planned and I need to release the meeting room (i.e. the calendar itself because the rooms are coming as calendar resources themselves) from the meeting, which API should I hit?

Actually I need to simulate real life scenario where I have a meeting scheduled in a meeting room but then I want to keep the meeting but not the room, so that the room is no longer occupied and others might use it. It is during implementation of this flow that I had above 2 doubts.

Please help me out here as I am completely new to programming and it has been days since I started banging my head over it.

Sparsh
  • 37
  • 6

1 Answers1

0

To answer your concerns, please see below:

  1. Yes, that is correct. The calendars mentioned(user and admin) are completely different calendars. As for modification in calendar B, as long as you have the calendarId, you can use Events: insert .

  2. The room should appear in the event resources and you can update it via Events: update.

Jason E.
  • 1,201
  • 1
  • 3
  • 10
  • I can't insert event, nor can I update. It is throwing 403 error. – Sparsh Sep 24 '21 at 16:17
  • Error 403 means you have no permission to edit on the calendar you are trying to create on. – Jason E. Sep 24 '21 at 17:08
  • Exactly, that was my original question. How do I update or insert an event in calendar B? – Sparsh Sep 25 '21 at 04:25
  • But you said you have super user access so why don't you have permission to edit the calendar? You can't update or insert an event on it unless you have access/permission to. – Jason E. Sep 28 '21 at 15:02