1
votes

I need a Graph api url that can be used in postman to add member into existing azure active directory security group

1
Hello, this question is very vague. Here is the API documentation to add members to a security group. docs.microsoft.com/en-us/graph/api/… start there. - Christopher Norris

1 Answers

1
votes

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