Barry Ralphs
Barry Ralphs

Reputation: 295

How to read Public calendar with MS Graph API

I've used the MS-Graph API and Azure AD with Oath to log into my site, but I'm now trying to read events from a Public Calendar that's shared with our organization. I've read through these links: Graph API - get events returning 500 internal server error

How to access shared calendars from Office REST API?

but they talk about an old sharing method that isn't available in the API. Are these calendars in "Public Folders" using this old method?

Here's what it looks like on outlook.office.com: web

Here's what the properties look like in Outlook:

Outlook

I've tried the MS-Graph Explorer to try to find the calendar, but can't

GET Request: https://graph.microsoft.com/v1.0/me/calendars

Expect to see calendars shared with me, but only see my main calendar.

Upvotes: 2

Views: 1987

Answers (1)

Joy Wang
Joy Wang

Reputation: 42153

If you sign into your app to call the MS graph api, your app need a Delegated permission Calendars.Read.Shared or Calendars.ReadWrite.Shared, and the request url should be GET https://graph.microsoft.com/v1.0/users/{userId of the one shared the calendar}/calendarinstead of the one you used.

Also, if you use the MS graph explorer, you should make sure your account has the Calendars.Read.Shared or Calendars.ReadWrite.Shared permission in the modify permissions.

See: Get Outlook events in a shared or delegated calendar.

Upvotes: 1

Related Questions