I am trying to get the list of mail folders of a user using microsoft graph API but getting an error Access is denied. Check credentials and try again.

Rahul Dewangan 21 Reputation points
2020-11-23T12:10:49.07+00:00

API : https://graph.microsoft.com/v1.0/users/******@k4mobility.com/mailFolders

I have created an app in Azure AD and also added the application permission
Mail.ReadWrite but I am getting an error "Access is denied. Check credentials and try again".

Community Center | Not monitored
{count} votes

Accepted answer
  1. Deva-MSFT 2,271 Reputation points Microsoft Employee
    2020-11-25T05:52:59.153+00:00
    • I see that you're using application permission. So check your token and see whether the user has necessary permissions/scopes to access other user mailbox or not. If not, please add and see if it helps. You can try to isolate the issue by testing with POSTMAN as well
    • For your scenario, you need to use App-only (aka client_credentials), this will allow your app to read/write any mailbox on the system. Validate the steps as per the documentation and it helped moving forward.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.