Office365 如何使用Microsoft Graph删除属性值
我想删除已存储的属性。Office365 如何使用Microsoft Graph删除属性值,office365,microsoft-graph-api,office365-restapi,Office365,Microsoft Graph Api,Office365 Restapi,我想删除已存储的属性。 例如,由于有“姓”的用户 GET https://graph.microsoft.com/v1.0/users/test01@test.onmicrosoft.com?$select=id,userPrincipalName,surname response: { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,userPrincipalName,surname
例如,由于有“姓”的用户
GET https://graph.microsoft.com/v1.0/users/test01@test.onmicrosoft.com?$select=id,userPrincipalName,surname
response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,userPrincipalName,surname)/$entity",
"id": "8e05e09b-c195-4404-87c1-2325767b66cd",
"userPrincipalName": "test01@test.onmicrosoft.com",
"surname": "ABCDEF"
}
在这种情况下,我想删除“姓氏”。当更新为null时,也不会删除,值不会更改
PATCH https://graph.microsoft.com/v1.0/users/test01@test.onmicrosoft.com
{
"surname": null
}
在“”中更新是一个错误
请告诉我如何删除。目前,Microsoft Graph REST API无法删除姓氏或将此属性设置为null 作为一种解决方法,我们可以创建一个不指定此属性的新用户。以下是其余内容供您参考:
POST:https://graph.microsoft.com/v1.0/users
authorization: bearer {token}
{
"accountEnabled": true,
"displayName":"displayName",
"mailNickname":"mailNickname",
"passwordProfile":
{"forceChangePasswordNextSignIn":false,"password":"Password@-1234"},
"businessPhones": [
"businessPhones-value"
],
"userPrincipalName":"test@tenant.onmicrosoft.com"
}
如果您希望Microsoft Graph支持此功能,可以从提交反馈。目前,Microsoft Graph REST API无法删除姓氏或将此属性设置为null 作为一种解决方法,我们可以创建一个不指定此属性的新用户。以下是其余内容供您参考:
POST:https://graph.microsoft.com/v1.0/users
authorization: bearer {token}
{
"accountEnabled": true,
"displayName":"displayName",
"mailNickname":"mailNickname",
"passwordProfile":
{"forceChangePasswordNextSignIn":false,"password":"Password@-1234"},
"businessPhones": [
"businessPhones-value"
],
"userPrincipalName":"test@tenant.onmicrosoft.com"
}
如果您希望Microsoft Graph支持此功能,可以从提交反馈。自2016年7月28日起,Microsoft Graph现在通过传递“null”来删除属性值,因此
PATCH https://graph.microsoft.com/v1.0/users/test01@test.onmicrosoft.com
{
"surname": null
}
应该可以工作。从2016年7月28日起,Microsoft Graph现在通过传递“null”来删除属性值,因此
PATCH https://graph.microsoft.com/v1.0/users/test01@test.onmicrosoft.com
{
"surname": null
}
应该有用。谢谢,我收到了反馈。谢谢,我收到了反馈。