question

YechielHadad-2998 avatar image
0 Votes"
YechielHadad-2998 asked YechielHadad-2998 edited

Unable to subscribe shared mailbox to a messages change

Hi,
I'm trying to POST a subscription for a shared mailbox to "messages(inbox)" notifications.
I'm using an access token of a user mailbox that has full access permission on it.
Unfortunately, I'm getting the next error:
"Operation: Create; Exception: [Status Code: Forbidden; Reason: Access is denied. Check credentials and try again.]"

Please let me know if I've missed out anything.


Best,
Yechiel

microsoft-graph-notifications
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sheena-MSFT avatar image
0 Votes"
Sheena-MSFT answered

Hi @YechielHadad-2998,

According to this documentation, to subscribe notifications for messages in a shared mailbox use the corresponding application permission scope.

201444-appl.png


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".





appl.png (111.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YechielHadad-2998 avatar image
0 Votes"
YechielHadad-2998 answered YechielHadad-2998 edited

Hi @Sheena-MSFT,
Thank you for your response.
I'm asking about a shared mailbox, not a shared folder.
In the meantime, I saw something strength when I opened the JWT of two users that gave our app permission through the OAuth2 process.

The first one has the next scopes:
email Mail.Read Mail.Read.Shared Mail.ReadWrite Mail.ReadWrite.Shared Mail.Send Mail.Send.Shared openid profile User.Read

The second one the next scopes:
Mail.Read Mail.ReadWrite Mail.Send openid profile email

The first one successfully subscribed for messages webhook of a shared mailbox that it has full access permission.
The second one manages a shared mailbox as well, but the subscription fails as mentioned above.

How do two users that passed the same OAuth2 process have different scopes?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.