Reputation: 29
I need a Graph api url that can be used in postman to add member into existing azure active directory security group
Upvotes: 1
Views: 1260
Reputation: 15609
The Graph api url that can add member into existing azure active directory security group is
POST https://graph.microsoft.com/v1.0/groups/{id}/members/$ref
Content-type: application/json
Content-length: 30
{
"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{id}"
}
Refer to this for more details.
To call graph api, you need to get an access token first. Here are two ways to get the access token.
1.Client Credentials Flow
2.Authorization Code Flow
Note: Client Credentials Flow needs Application permission, Authorization Code Flow needs Delegated permission.
Update: This api also works for security group. I have added a user to the security group successfully.
Upvotes: 1