Unable get messages via Microsoft Graph API in postman

Liyang Wan 1 Reputation point
2020-06-28T06:21:39.92+00:00

Hi,

I follow this https://learn.microsoft.com/en-us/graph/use-postman to set up application API calls.

I'm able to get users via API: https://graph.microsoft.com/v1.0/users

but not able to get messages via API: https://graph.microsoft.com/v1.0/users/{{UserId}}/messages, it show me error below.

{
"error": {
"code": "AuthenticationError",
"message": "Error authenticating with resource",
"innerError": {
"date": "2020-06-28T06:16:03",
"request-id": "c0c3d9d5-9fa5-47a0-8b81-df85663ba297"
}
}
}

API Permission granted as below, could anyone advise how to fix above error?

10787-azurepermission.png

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,473 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. mE 7006 6 Reputation points
    2021-11-24T18:21:47.733+00:00

    I am getting the same error from calendar API? Any other solutions?

    1 person found this answer helpful.
    0 comments No comments

  2. AmanpreetSingh-MSFT 56,306 Reputation points
    2020-06-29T08:58:47.123+00:00

    Hello @LiyangWan-8349

    Based on the error, it appears that the token that you are trying to use is not issued for correct audience, which should be https://graph.microsoft.com in this case. Please try using https://graph.microsoft.com/.default value for the scope parameter in your token request body and try making the get message call again with the new token.

    Also, the application permissions are applicable if you are using client_credentials flow to get a token. If you are using any other flow to get the token, you would need to add Mail.Read and Mail.ReadBasic.All permissions as delegated permissions.

    If you still face any issues, please share the screenshot of Postman with the token request call and the body parameters (hiding the confidential information).


    Please do not forget to "Accept the answer" wherever the information provided helps you. This will help others in the community as well.

    0 comments No comments

  3. npaul 1 Reputation point
    2020-10-30T17:36:54.467+00:00

    After having the scope you mentioned above and the required permissions. we are seeing this issue

    0 comments No comments

  4. Dev User 1 Reputation point
    2021-06-02T15:24:22.65+00:00

    Any solution for this issue? We are also facing the same issue.

    0 comments No comments