PATCH https://graph.microsoft.com/v1.0/users/{USERID}/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7
Content-type: application/json
{
"phoneNumber": "+1 2065555554",
"phoneType": "mobile",
}
response:
code: 'resourceNotFound',
message: 'The requested authentication method with id [3179e48a-750b-4051-897c-87b9720928f7] was not found for this user, and cannot be updated'
如果您尝试更新手机方法时,则会发生错误。
我有一个用户使用电话身份验证方法添加的用户,如下:
当我尝试将该手机方法更新为
和ID中时,将手机方法和ID更新为3179E48A-750B-4051-897C-87B9720928F7,我也有SAME误差。
mobile
在此MMS文档中提到
,
可更改的值the的值,具体取决于要更新的poneType:PATCH https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7
{
"phoneNumber": "+1 2065555554",
"phoneType": "mobile"
}
更新phoneMethodId
b6332ec1-7057-4abe-9331-3d72feddfe41
phonetype.
alternateMobile
更新e37fc753-ff3b-4958-9484-eaa9425c82bc
office
phonetype.
3179e48a-750b-4051-897c-87b9720928f7
mobile
phonetype.GET https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/
您现在可以使用补丁调用作为电话方法
- 在您的情况下,最初以下面的API调用添加到用户添加到用户的电话列表:
mobile
response:- 如果不存在响应,请使用后调用将其添加为身份验证方法,如下所示:
POST https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/ { "phoneNumber": "+1 2065555554", "phoneType": "mobile" }
- response:
mobile
phonetype
现在存在:PATCH https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7
{
"phoneNumber": "+1 2055555555",
"phoneType": "mobile"
}
response:
确认,我在Portal中检查了同样的手机方法mobile
Phonetype成功更新: