Graph API help

Sureshkumar Vairamani 0 Reputation points
2023-01-25T23:44:32.34+00:00

Hi,

When trying to get list of messages of a user ******@imail.org using the following api resource

[https://graph.microsoft.com/v1.0/users/ddb44626-03f2-4058-baec-a4a1edfa8051/messages

Please help us in figuring out why it is not getting the access. The app registration app which I am trying to use it

Display name

:

Intermountain APE

Application (client) ID

:

d9178be1-c22a-40f2-b09a-a5b5ee8bb0a9

I am getting the following error.

{
    "error": {
        "code": "ErrorAccessDenied",
        "message": "Access is denied. Check credentials and try again."
    }
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,992 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 6,071 Reputation points
    2023-01-26T00:23:53.6066667+00:00

    Hi @Sureshkumar Vairamani

    "ErrorAccessDenied" usually occurs when generated token does not have sufficient permissions or the consented permission are not granted by Admin. As per the documentation Mail.ReadBasic.All, Mail.Read Permissions (from least to most privileged) is required to run the above Graph API endpoint.

    Please make sure you have the above permissions in your token. You can check your permissions by decoding your token using Jwt.io.

    Hope this helps.

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

    0 comments No comments

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.