How to identify Google calendar 'Out of office' events using Calendar API

Viewed 585

I need a way to identify if a given Google calendar event is an 'Out of office' event using the Google Calendar API.

Previously I used to check the 'description' field of the event object, but it seems that Google has discontinued sending that field.

Simply, what I need to find is whether a Google user is on Vacation/Out-of-office on a given date. Thanks.

1 Answers

When you create an Out of office event, this becomes the summary - not the description - of the event.

You can query with Events: list , simply setting the free text search parameter q to "Out of office" and should obtain a response looking like the following:

{
  "kind": "calendar#events",
    ...
    "items": [
      {
        ...
        "created": "2020-11-11T08:19:11.000Z",
        "updated": "2020-11-11T08:19:11.213Z",
        "summary": "Out of office",
        "creator": {
        "email": "XXX",
        "self": true
      },
      ...
      }
    ]
}

Related