如何更新用户生日 [英] How to update the users birthday
问题描述
我想使用补丁程序请求更新用户的 birthday
.更新其他属性可以按预期工作,但是包含 birthday
属性的那一刻,将返回以下错误:
I want to update the birthday
of a user using the patch request.
Updating other properties works as expected but the moment the birthday
property is included, the following error returned:
目标实体集当前不支持该请求
The request is currently not supported on the targeted entity set
我已经尝试更新用户,以确保权限正常.
I already tried to update the user to be sure the permissions are fine.
使用了应用程序权限.
对/V1.0/users/{id}
的 PATCH
请求有效:
{
"givenName": "Fridas"
}
但是传递此请求正文:
{
"givenName":"Fridas",
"birthday" : "2014-01-01T00:00:00Z
}
引发错误
{
"error":
{
"code":"BadRequest",
"message":"The request is currently not supported on the targeted entity set",
"innerError":
{
"request-id":"5f0d36d1-0bff-437b-9dc8-5579a7ec6e72",
"date":"2019-08-13T15:27:40"
}
}
}
分别更新生日时,出现500错误.打印下面的屏幕.更新用户ID可以正常工作,而生日则不能.请求中使用了相同的用户ID.
When I update the birthday separately, I get a 500 error. Print screens below. Updating the user id works fine, birthday does not. Same user id is used in the request.
推荐答案
我不确定为什么会这样,但是一种解决方法(尽管很烦人)是将生日与其他属性分开更新.
I'm not sure why this happens, but a workaround, albeit an annoying one, is to update birthday separately from other attributes.
例如
PATCH https://graph.microsoft.com/v1.0/users/userid
{
"birthday" : "2014-01-01T00:00:00Z"
}
这是MS Graph Explorer的屏幕截图:
Here is a screenshot from MS Graph Explorer:
这篇关于如何更新用户生日的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!