Problem in Integration of Graph API

2021-10-17T09:59:04.7+00:00

I am trying to get emails from sentItems folder.
For testing Purposes I am using Postman client.

I am successfully getting access token by using "https://login.microsoftonline.com/common/oauth2/token"
but when I use this access token for "https://graph.microsoft.com/v1.0/me/mailFolders/SentItems/messages?"
I am getting this error
"/me request is only valid with delegated authentication flow." .

Attaching SS of permissions.

141101-image.png

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,906 Reputation points Microsoft Employee
    2021-10-22T05:49:34.233+00:00

    You seem to be using application permissions to access /me. /me end point and its extensions like /me/mailFolders/SentItems/messages require a signed in user ie delegated permissions. Acquire a token using delegated permissions and try again.

    See Auth Code Flow which will include the delegated permissions in your token.
    See Permission types on the difference between delegated and application permissions.

    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.