Search code examples
outlookmicrosoft-graph-apioutlook-restapimicrosoft-graph-calendarmicrosoft365

Getting group calendars via Microsoft 365 API


I'm trying to use the Microsoft Graph API to retrieve an Outlook Group Calendar.
By this, I mean one of the calendars that appears in the "groups" section in Outlook, like in this picture:

enter image description here

However, I can't figure out how to do it. If I make a request to:

/users/[email protected]/calendarGroups

I get three groups: My Calendars, Other Calendars and People Calendars.

However, if I then try to list the calendars of each group by calling:

/users/[email protected]/calendarGroups/calendar_id/calendars

I see that none of them contain the calendars I'm looking for (the ones shown in the screenshot). In fact, the first group contains my personal calendars and the other two are empty.

What am I missing here?


Solution

  • After further investigation, I can confirm you cannot use the standard API to get shared calendars. You need to use the Delegated Authentication flow and connect on behalf of a specific user that has access to the calendar. Only in that case you'll be able to obtain the calendar data.