Resource not found for the segment user - Application Token

故事扮演 提交于 2019-12-12 05:39:56

问题


I am able to authenticate and get an application token to use the Microsoft Graph API. I have set all of the delegated and admin permissions to have access to the users. I have also used the graph explorer to verify what permissions I need: https://developer.microsoft.com/en-us/graph/graph-explorer#

I verified my user GUID (my ID) through Azure AD as well as the Graph Explorer using their https://graph.microsoft.com/v1.0/me/ call while signed in. Given I'm using the application token so I must specify a user (see below).

Here is what I'm passing

GET https://graph.microsoft.com/v1.0/user/{my GUID from Azure AD}
Authorization: bearer {myAccessToken}
Content-Type: application/json

I suspect it's a syntax issue or a permissions issue.


回答1:


The URL should be:

https://graph.microsoft.com/v1.0/users/{GUID}

And you instead of a Content-Type header, you should send a:

Accept: application/json


来源:https://stackoverflow.com/questions/44975760/resource-not-found-for-the-segment-user-application-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!