我正在尝试通过以下MS Graph API添加成员:https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http,但遇到权限问题。请求返回
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation."
我可以调用https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http之类的API,而没有任何权限问题,并且具有Group.ReadWrite.All和User.ReadBasic.All权限。调用此API是否需要特殊的权限或角色?
答案 0 :(得分:1)
是的,您还需要GroupMember.ReadWrite.All
和Directory.ReadWrite.All
Application
权限。
PostMan Request URL:
https://graph.microsoft.com/v1.0/groups/93d96b98-YourGroupId_3ede399/members/$ref
PostMan Request Body:
{
"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/b33ce735_YourUserId_15337c469076"
}
Postman Test:
注意:确保添加权限后,您已接受授权管理员的同意。