Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check Redeem status of Directory Invitation through Microsoft Graph

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": "[email protected]",
  "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

like image 904
Alx Avatar asked Feb 04 '23 09:02

Alx


1 Answers

I found it in the graph explorer:

https://graph.microsoft.com/v1.0/users?
  $filter=(UserType eq 'Guest') and (mail eq '[email protected]')&
  $select=externalUserState
like image 85
Luca Ziegler Avatar answered Apr 09 '23 13:04

Luca Ziegler