I would like to create a subscription for incoming mails on a shared mailbox with Microsoft graph.
Background:
I have an app created with delegated user rights:
Read all webhook subscriptions (preview)
Read and write user mailbox settings
Read and write user and shared mail
- I have created a shared mail box
- I have added a user to that shared mailbox.
- I have added the shared mailbox to the users folders so I see users mailbox and the shared mailbox in the WEB GUI
I have created a c# program to receive auth token, created subscriptions and listed messages from a mailbox
What works:
Receiving auth token
List messages of users mail box
- List messages of shared mailbox
- Create subscription on users mail box
It does not work if I try to create a subscription for incoming mails in the shared mail box.
My resource string during creation of the subscription is:
Resource = users/xx@xxx.onmicrosoft.com/mailFolders('Inbox')/messages
As said works well with the users mail address but fails using the shared mail box address:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Forbidden]",
"innerError": {
"request-id": "xxxxx-8515-4048-8c05-f3eb91a1f69a",
"date": "2018-12-13T15:17:09"
}
}
}Subscription failed because:Forbidden
Did I use the wrong resource string here or did I miss an app right here?