Microsoft graph add member

Brass Contributor

I'm trying to add a member to an existing team through graph API. I'm doing the following:

 

1. Obtained the bearer access token by using client_credentials flow

2. Obtained the id of the user and group object

3. Invoked the graph api (https://graph.microsoft.com/v1.0/groups/{groupd_id}/members/$ref) using the bearer token and the following odata object in the body

{

"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{user_id}"

}

I get the following error when doing so.

 

clipboard_image_0.png

 

I checked the permission for the applications and everything seems to be right (see below). What could be the problem?

 

clipboard_image_2.png

1 Reply
In the body, try this instead:

"@odata.id": "https://graph.microsoft.com/v1.0/users/{user_id}"