Trouble reading all emails from shared inbox

Jan Langdeel Pedersen 1 Reputation point
2021-07-22T08:00:54.57+00:00

Hi
I am trying to create an application to read and move emails from a shared mailbox using the Microsoft Graph API. I have given my app delegated permissions to do so.
I have obtained an authorization code and then use the token endpoint to get my bearer token. At jwt.ms I can see that my token has the following scope:
'Mail.Read Mail.Read.Shared Mail.ReadWrite.Shared openid profile User.Read User.ReadBasic.All email'

But still I am getting an Access is denied error when trying to read emails from a shared mailbox. The error message is:
"Access is denied. Check credentials and try again. REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com/"
What am I missing? It works just fine when I read mails from my personal inbox.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,035 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.