0
votes

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

Add the /invitations endpoint to add my user ( I do not use email invitation)

Then I can see from my AD users that it has been added properly

Next I user the /groups/{Group ID}/members/$ref to add the created users in step 1

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 your help

regards

1

1 Answers

0
votes

That was my mistake, I get a scrip flag error which prevent the api to complete