【发布时间】:2019-06-06 13:29:07
【问题描述】:
我在 azure 广告中添加了一个用户。现在使用graph api 我想更新它的显示名称或者说密码。我指的是这个指南https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=cs
首先,我不确定我是否使用正确的 URL 来更新用户,但以下是我正在使用的:
https://graph.microsoft.com/v1.0/users/john@<myorg>.onmicrosoft.com
我正在传递我想在 url 中更新的用户的 userName。如果这不正确,请告诉我。
我在我的请求中包含OAuth token 作为不记名令牌并发布以下 json:
{
"accountEnabled": true,
"displayName": "john12"
}
从上面的 json 中,我想将显示名称从 john 更改为 john12。但我得到以下错误:
{
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"request-id": "536fd7c1-db46-4927-9732-169da778811c",
"date": "2019-06-06T04:58:26"
}
}
}
请任何人告诉我如何更新现有的用户属性。谢谢
【问题讨论】:
标签: azure azure-active-directory microsoft-graph-api