Adding Guest user to Group using Graph API

serge calderara (Solatys) 116 Reputation points
2020-05-13T14:29:06.293+00:00

Dear all,

When I use graph API withinh POSTMAN in order to add a guest user to a group I process as follow :

  1. Add the /invitations endpoint to add my user ( I do not use email invitation)
  2. Then I can see from my AD users that it has been added properly
  3. Next I user the /groups/{Group ID}/members/$ref to add the created users in step 1
  4. Then I can see from my AD that users has been added to group right a way

Then this exact steps, I add it in a script that is executed at a dedicated time as follow:

  1. use the /invitations endpoint to add my user and Send an invitation by email
  2. The return userID by first call is then used to add right away the user to the group by using the /groups/{Group ID}/members/$ref endpoint with body set as

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

Then response to add user to group is successfull

Then what is strange is that when I check in my AD , I can see the user which has been created BUT I do not see that user as a member of the group it has been added.
It is not displayed while no error was return during the API call

Does it means it takes some time to get it visible ?
Does it means that user need to validate the invitation before it is added to the group ?

Thanks for clarification

regards

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,513 questions
{count} votes

1 answer

Sort by: Most helpful
  1. serge calderara (Solatys) 116 Reputation points
    2020-05-14T08:11:23.417+00:00

    I manage to identify the issue.
    It was my mistake in my script

    PS : This forum is a nightmare to post, it failed most of the time, do not respond frequently.

    0 comments No comments