0
votes

I am using the guest user invitation api as defined here to add a guest user to my Active Directory.

The post request succeeds with a 201 response code and returns the following data:

{
   "@odata.context":"https://graph.microsoft.com/v1.0/$metadata#invitations/$entity",
   "id":"xxx",
   "inviteRedeemUrl":"https://invitations.microsoft.com/redeem/?tenant=xxx&ticket=xxx&ver=2.0",
   "invitedUserDisplayName":"xxx",
   "invitedUserType":"Guest",
   "invitedUserEmailAddress":"[email protected]",
   "sendInvitationMessage":false,
   "inviteRedirectUrl":"http://localhost:4200/",
   "status":"PendingAcceptance",
   "invitedUserMessageInfo":{
      "messageLanguage":null,
      "customizedMessageBody":null,
      "ccRecipients":[
         {
            "emailAddress":{
               "name":null,
               "address":null
            }
         }
      ]
   },
   "invitedUser":{
      "id":"xxx"
   }
}

When I check the active directory using the Azure UI, I see that the user is created in the directory. But I never receive an invitation email, unless I click the resend invite button in the UI for the user.

How can I make sure that an invite email is sent when I send my request to the invite api, without having to manually click the resend invite button for the user?

1

1 Answers

1
votes

Silly mistake on my part. You need to add the sendInvitationMessage: true property in your request json payload in order to send the email. The documentation for allowed properties in your request object is here https://docs.microsoft.com/en-us/graph/api/resources/invitation?view=graph-rest-1.0