Google Calendar Api, Is meeting Room available?

后端 未结 2 1242
别那么骄傲
别那么骄傲 2021-01-05 05:24

How do you list availability of a spacific calendar resource(Room) for a specific DateTime? Like if I want to list all Today\'s events for meeting Room(across all user accou

相关标签:
2条回答
  • 2021-01-05 05:43

    You will need to be authenticated as a user that has read-access to the room. Then you can take the resourceEmail field of the Calendar Resource API and use it as a calendarId in the events.list() Calendar API call.

    0 讨论(0)
  • 2021-01-05 05:43

    You can use freebusy API method for check if meeting room is available. Sample request:

    POST https://www.googleapis.com/calendar/v3/freeBusy?fields=calendars&key={YOUR_API_KEY}
    
    {
     "timeMin": "2018-10-18T06:30:00Z",
     "timeMax": "2018-10-18T17:00:00Z",
     "items": [
      {
       "id": "%CONFERENCE_ROOM Email ID%"
      }
     ],
     "timeZone": "GMT"
    }
    

    Sample response:

    {
     "calendars": {
      "%CONFERENCE_ROOM Email ID%": {
       "busy": [
        {
         "start": "2018-10-18T07:45:00Z",
         "end": "2018-10-18T09:15:00Z"
        },
        // ...
       ]
      }
     }
    }
    

    Here you can play with Calendar API Explorer.

    0 讨论(0)
提交回复
热议问题