通过 Graph API 将成员添加到组的权限 [英] Permissions to add member to group via Graph API
问题描述
我正在尝试通过此 MS Graph API 添加成员:
PostMan 请求 URL:
https://graph.microsoft.com/v1.0/groups/93d96b98-YourGroupId_3ede399/members/$ref
PostMan 请求正文:
<代码>{"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/b33ce735_YourUserId_15337c469076"}
邮递员测试:
加入群组:
注意:请确保在添加权限后您已接受授予管理员同意.
请参考官方文档
I am trying to add a member via this MS Graph API: https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http but am running into permission issues. The request returns back
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation."
I am able to call APIs like https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http with no permission problem, and I have Group.ReadWrite.All and User.ReadBasic.All permissions. Is there a special permission or role I need to be to call this API?
Yes you also need GroupMember.ReadWrite.All
and Directory.ReadWrite.All
Application
permission.
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:
Added On Group:
Note: Make sure after adding permission you have accepted grant admin consent.
Please refer to Official Document
这篇关于通过 Graph API 将成员添加到组的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!