Which api should be used to check the mail.readwrite and user.read permissions are granted or not

Krishna 21 Reputation points

If I call this method
var responseStatusString = await httpClient.GetStringAsync(https://graph.microsoft.com/v1.0/servicePrincipals?$filter=DisplayName eq 'Microsoft Graph')

Getting below error
Response status code does not indicate success: 403 (Forbidden).



Microsoft Graph Mail API
Microsoft Graph Mail API
A Microsoft API that supports accessing data in users' primary mailboxes and in shared mailboxes.
909 questions
0 comments No comments
{count} votes

Accepted answer
  1. RajeshKumarMSFT 1,956 Reputation points Microsoft Vendor

    Hi @Krishna ,

    Hope you are doing well,

    I have tried to reproduce the the scenario to get assigned/granted permissions as per your requirement mentioned.
    Please use the below endpoint and grant the required permissions before running endpoint as per this reference link

    API :- https://graph.microsoft.com/v1.0/servicePrincipals/*******/oauth2PermissionGrants?$select=scope


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

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Krishna 21 Reputation points

    Added Application.Read.All permission , and things are working now,

    Thanks @RajeshKumarMSFT

    0 comments No comments