Get access to Microsoft Graph API without a user


Hello everyone has i said above im trying to get access to Microsoft Graph API without a user, and there are 5 steps to do this (https://docs.microsoft.com/en-us/graph/auth-v2-service):

  1. Register your app. (DONE)
  2. Configure permissions for Microsoft Graph on your app. (DONE)
  3. Get administrator consent. (DONE)
  4. Get an access token.(DONE)
  5. Use the access token to call Microsoft Graph. (PROBLEM)

In Step 5 im using the API method to list all users and im having this error:

I have been trying so solve this error but i cant make it work.


ADDICIONAL INFORMATION:


This are my permissions:


This is how i get the token:

Thank You in advance for the help.

Best Regards,
Diogo Fonseca

Anyone?

Hi Diogo,

It seems like not all steps were finished succesfully. This is the only logical answer after reading.

Perhaps this will help you more, since this doesn't seem to be an Outsystems issue:

https://stackoverflow.com/questions/37151346/authorization-identitynotfound-error-while-accessing-graph-api

Hope it will get you closer to the solution.

Stefano Valente wrote:

Hi Diogo,

It seems like not all steps were finished succesfully. This is the only logical answer after reading.

Perhaps this will help you more, since this doesn't seem to be an Outsystems issue:

https://stackoverflow.com/questions/37151346/authorization-identitynotfound-error-while-accessing-graph-api

Hope it will get you closer to the solution.

Hi Stefano,

I already looked in Stack Overflow and i tryed to do what they said there and it didnt work.


Could you check if your admin consent was succesfull? 

Stefano Valente wrote:

Could you check if your admin consent was succesfull? 

Yes i already checked 


Solution

I found the solution thank you anyway 

It was Missing the Accept header. :)


Solution