Forum Discussion

eynarain's avatar
eynarain
Brass Contributor
Aug 05, 2019

Microsoft graph add member

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/%7bgroupd_id%7d/members/$ref) using the bearer token and the following odata object in the body

{

"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/%7buser_id%7d"

}

I get the following error when doing so.

 

 

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

 

1 Reply

  • Rob Ellis's avatar
    Rob Ellis
    Bronze Contributor
    In the body, try this instead:

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

Resources