I am trying to get the messages from outlook mailbox of a specific user. I created an app with permissions type "application" and permissions Mail.ReadBasic.All, Mail.Read, Mail.ReadWrite. I provided adminconsent with below url:
https://login.microsoftonline.com/{tenant}/adminconsent?client_id={}&secret_id={}&state=12345&redirect_uri=http://localhost:3000/myapp
and it returned adminconsent=true.
I am able to generate the token with https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token.
But when acccessing graph api I am getting unknown error.
https://graph.microsoft.com/v1.0/users/{mail id}/mailfolders/inbox/messages
Header : Authorization = Bearer ey....
Error:
{ "error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "62f75bdd-948b-4f35-a400-cbc1650d37f7",
"date": "2020-01-31T07:00:00"
} } }