sql developer
sql developer

Reputation: 29

Graph api url to add members into azure active directory security group

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

Answers (1)

Tony Ju
Tony Ju

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

https://blogs.msdn.microsoft.com/aaddevsup/2018/05/21/using-postman-to-call-the-microsoft-graph-api-using-client-credentials/

2.Authorization Code Flow

https://blogs.msdn.microsoft.com/aaddevsup/2018/05/23/using-postman-to-call-the-microsoft-graph-api-using-authorization-code-flow/

Note: Client Credentials Flow needs Application permission, Authorization Code Flow needs Delegated permission.

enter image description here

Update: This api also works for security group. I have added a user to the security group successfully.

enter image description here

Upvotes: 1

Related Questions