Marek
Marek

Reputation: 1788

How to check other user availability with Microsoft Graph API?

I'm trying to implement checking availability for specific user (actually a room) in O365 calendar. I'm using Graph API as it's recommended by Microsoft.

My first approach was using POST on https://graph.microsoft.com/v1.0/me/findMeetingTimes with the message body prepared according to template given in Graph API Explorer. On the API Explorer everything seems to work fine but when I try to run exactly the same request with my applications token I receive 403:

{
  "error": {
    "code": "ErrorAccessDenied",
    "message": "Access is denied. Check credentials and try again.",
    "innerError": {
      "request-id": "b130177d-e138-4cc7-8e72-5d3529a9dc24",
      "date": "2017-03-21T08:47:10"
    }
  }
}

I checked the app's delegated permissions in AAD and they seem to be fine. For Microsoft Graph those are granted:

I get exactly the same response (403) when I try to simply list user's events: https://graph.microsoft.com/v1.0/users//events In Graph API Explorer 500 is returned.

I found the following bug description: https://github.com/microsoftgraph/microsoft-graph-docs/issues/559 (and probably this one too) Is it related with the issues above?

Any clue what I might be doing wrong?

Is there any other way to achieve the same using different endpoint or API assuming that I still want to use oAuth for authorization?

I will be grateful for any hint


Update: Outlook Calendar API seems to work. Still appreciate any ideas why Graph API doesn't?

Upvotes: 0

Views: 1648

Answers (1)

Apoorv
Apoorv

Reputation: 2043

The FindMeetingAPI needs A work or a school account . If you are logging in using your personal email ID , you might not be able to login. Moreover , you need to set permissions to Calendars.Read Calendars.Read.All Calendars.ReadWrite User.Read"

Upvotes: -1

Related Questions