Graph api - Shared email box - forbidden error

Prashant anand 1 Reputation point
2022-05-11T14:11:45.117+00:00

I am using graph-api and i have added access to mail.read.shared in app permissions (Azure AD).

i am not able to read shared user emails, getting erroraccesssdenied.

please help.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,882 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AtulThorat-MSFT 391 Reputation points
    2022-05-11T15:25:45.113+00:00

    Hi @Prashant anand ,

    Hope you are doing well.

    Outlook also allows a customer to delegate another user to act on the customer's behalf, and access specific mail folders or the customer's entire mailbox; this is also known as "delegation" in Outlook.

    Microsoft Graph supports getting messages in mail folders that have been shared by other users, as well as getting the shared folders themselves. The support also applies to folders that have been delegated.

    As per outlook-share-messages-folders we have to use delegation scope while granting permission "Mail.Read.Shared".

    Use the delegated permissions, "Mail.Read.Shared" or "Mail.ReadWrite.Shared", to respectively read or write messages in a shared or delegated folder.

    For more information, see permissions-reference

    Please refer below graph api permission for this same.

    201038-mailreadshared.png

    Hope this helps.

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

    0 comments No comments

  2. Prashant anand 1 Reputation point
    2022-05-11T15:48:20.547+00:00

    Thanks for the response @AtulThorat-MSFT .

    I had used same permissions level in my api permissions, ans it is saying - 'No' for the admin consent. just lie your screen shot mentioned.

    I can add another user calendar from my outlook becasue that user shared it with me.

    but when i am creating api with this same permissions sets, it is showing me access error.

    0 comments No comments