Reputation: 201
When creating subscription using Graph API, we are getting the below error even if we have enough permission in access token.
Token permissions: Calendars.ReadWrite Contacts.ReadWrite Tasks.ReadWrite User.Read profile openid email
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Access is denied to the requested resource. The user might not have enough permission.]",
"innerError": {
"date": "2022-11-30T08:23:03",
"request-id": "0541655d-83f3-456e-af47-165caf259c76",
"client-request-id": "0541655d-83f3-456e-af47-165caf259c76"
}
}
}
Details used:
Request url :
POST https://graph.microsoft.com/v1.0/subscriptions
Request body:
{
"notificationUrl":"<development-url>/notifications/office365/graph/v1",
"expirationDateTime":"2022-12-03T06:48:06Z",
"resource":"/me/todo/lists/{taskListId}/tasks",
"changeType":"created,updated,deleted",
"clientState":"<client-state>"
}
API used - https://graph.microsoft.com/v1.0/subscriptions (Microsoft documentation)
Issue affected users count - 190
Upvotes: 5
Views: 192
Reputation: 738
As per the doc to create the subscription for todoTask , User must have Tasks.ReadWrite deligated permission ,its not supported for application permission , could you please check what permission you have ?
Hope this helps
Thanks
Upvotes: 0