Kuan Wei Liao
Kuan Wei Liao

Reputation: 43

Calendar.Read in Application Permissions

I've registered an app on Microsoft Application Registration portal. I added a Calendar.Read permission in Application Permissions. How can I get the calendar of the organization by sending the access token in MS Graph API?

https://i.sstatic.net/MNsuH.jpg

I've noticed that Amazon get the calendar event of users' organization by using Calendar.Read permission. This is what I've done:

First, I went to this website to get tenant ID

https://login.microsoftonline.com/common/adminconsent?%20client_id=[MyClientID]%20&state=12378%20&redirect_uri=http://localhost

I filled in 4 keys in this url: grand_type(value=client_credentials), client_ID, client_secret, resource(app id uri). Then, I got an access token. I insert the access token into graph api. I got an error response code "Authentication_MissingOrMalformed"

https://login.microsoftonline.com/[MyTenantID]/oauth2/token

And what can I do with the token I've got in this URL?

Thanks for answering.

Upvotes: 0

Views: 2135

Answers (1)

juunas
juunas

Reputation: 58733

You should check the documentation: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_calendars.

You need the Calendars.Read or Calendars.ReadWrite application permission on the Microsoft Graph API. The permission you have only allows you to read Azure AD info, not Outlook calendars.

Also, the resource must be https://graph.microsoft.com, since that is what you want to call.

Upvotes: 1

Related Questions