Reputation: 277
I'm working on a project in which I need to create events in my calendar, for this I am using the GRAPH API and there should be no user interaction. I'm using my personal account.
As a test I am making a call in Postman to which I add the token I got from the URL
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
https://graph.microsoft.com/v1.0/users/me/events
{
"subject": "My event",
"start": {
"dateTime": "2020-06-22T13:32:53.037Z",
"timeZone": "UTC"
},
"end": {
"dateTime": "2020-06-29T13:32:53.037Z",
"timeZone": "UTC"
}
}
But I'm getting this error
{ "error": { "code": "NoPermissionsInAccessToken", "message": "The token contains no permissions, or permissions can not be understood.", "innerError": { "requestId": "b4ffb07b-8a7b-4893-93ae-1a3bb8be8f28", "date": "2020-06-23T03:14:49", "request-id": "b4ffb07b-8a7b-4893-93ae-1a3bb8be8f28" } } }
Is this error because I don't have the admin consent or l'm doing something wrong?
Upvotes: 0
Views: 545
Reputation: 283
Did you register your app in Azure AD?
Please follow steps described here: https://learn.microsoft.com/en-us/graph/auth-v2-service?context=graph%2Fapi%2F1.0&view=graph-rest-1.0
Permission level you need is Calendar.ReadWrite
Upvotes: 0