question

sergecalderaraSolatys-4285 avatar image
0 Votes"
sergecalderaraSolatys-4285 asked ·

Adding Guest user to Group using Graph API

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






azure-active-directory
· 3
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@sergecalderaraSolatys-4285 It would be nice if you can provide your code snippet over here.

0 Votes 0 ·

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

1 Vote 1 ·
SaurabhSharma-msft avatar image SaurabhSharma-msft sergecalderaraSolatys-4285 ·

@sergecalderaraSolatys-4285 Good to hear that you are unblocked.

0 Votes 0 ·

1 Answer

sergecalderaraSolatys-4285 avatar image
0 Votes"
sergecalderaraSolatys-4285 answered ·

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.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.