我想一次通过office365 api向用户添加多个角色。
但是通过api,哪个链接是
https://docs.microsoft.com/en-us/graph/api/directoryrole-post-members?view=graph-rest-1.0&tabs=javascript
。
我使用如下所示的api
POST https://graph.microsoft.com/beta/directoryRoles/{roleId}/members/$ref
Request Body(which type is [directoryObject][https://docs.microsoft.com/en-us/graph/api/resources/directoryobject?view=graph-rest-1.0]):
{
"id": "697c1e95-7184-45bc-a24b-2262b1b00bc7"
}
但是api返回
{
"error": {
"code": "Request_BadRequest",
"message": "An unexpected 'EndOfInput' node was found when reading from the JSON reader. A 'StartObject' node was expected.",
"innerError": {
"request-id": "af3f38c5-bc87-4136-bae2-643c84a23281",
"date": "2019-06-27T09:33:10"
}
}
}
我认为应该有问题,但是我找不到问题。
有人可以帮忙吗?可能是我使用了错误的api吗?