Check Redeem status of Directory Invitation through Microsoft Graph

Viewed 1997

I'm inviting a user to be added as a Member to my Active Directory using the Microsoft Graph REST API.

curl -X POST \
  https://graph.microsoft.com/v1.0/invitations \
  -H 'authorization: Bearer ey...Jg' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
  "invitedUserEmailAddress": "userInvite@hotmail.com",
  "inviteRedirectUrl": "https://example.com/afterInvite",
  "sendInvitationMessage": false,
  "invitedUserType":"Member"
}'

I do receive a correct response with the status field:

"status": "PendingAcceptance",

which of course is true as the user has just been invited. Is there a way to see if the user has redeemed the invitation yet?

Thanks a lot

4 Answers

I found it in the graph explorer:

https://graph.microsoft.com/v1.0/users?
  $filter=(UserType eq 'Guest') and (mail eq 'xx@yyy.com')&
  $select=externalUserState

we cannot use filter more than once. How about

https://graph.microsoft.com/v1.0/users?$filter=mail eq 'usersemail'&$select=externalUserState

this can be done using ms graph API

Related