Call to invitations at https://graph.microsoft.com/v1.0/invitations getting an unknown error

Vasquez Saenz, Javier (WDC) 20 Reputation points
2024-07-03T12:25:34.9+00:00

When invoking https://graph.microsoft.com/v1.0/invitations from our code the actual invitation get sent but the call returns a 504 timeout or an unknown error

We are calling it with this code //Invite AD Users sendInvite(inviteObj: any, token: any): Observable<any> { const httpgraphOptions = { headers: new HttpHeaders( { ‘Authorization’: Bearer ${token} } ) }; return this.httpClient.post<any>(https://graph.microsoft.com/v1.0/invitations, inviteObj, httpgraphOptions

) }

//Invite AD Users sendInvite(inviteObj: any, token: any): Observable<any> { const httpgraphOptions = { headers: new HttpHeaders( { ‘Authorization’: Bearer ${token} } ) }; return this.httpClient.post<any>(https://graph.microsoft.com/v1.0/invitations, inviteObj, httpgraphOptions

) }

And we get this error

{ “error”: { “code”: “UnknownError”, “message”: “”, “innerError”: { “date”: “2024-07-02T15:28:10”, “request-id”: “1d8ced3e-77dd-4357-ba45-2446f0593587”, “client-request-id”: “1d8ced3e-77dd-4357-ba45-2446f0593587” } } }

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,258 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vasquez Saenz, Javier (WDC) 20 Reputation points
    2024-07-05T20:25:10.4866667+00:00

    We did a workaround that involves triggering the call twice

    We send an invitation that is actually sent but returns a timeout

    After a delay we request for that email the user id

    If we don't get it, then we fail the invitation, otherwise we proceed with the registration.

    It is inefficient, but works

    0 comments No comments

  2. Hiroki Inoue 0 Reputation points
    2024-07-06T02:00:15.77+00:00

    I have a problem when I call the /invitation API. I'm getting timeout from Microsoft Graph. someone with the same problem? I saw that the problem happens when the "sendInvitationMessage" parameter is set to "true".

    error id: e53fd901-0a5c-4908-b136-75056c9a8bb3-1: jakarta.ws.rs.ProcessingException: The timeout period of 30000ms has been exceeded while executing POST /v1.0/invitations for server graph.microsoft.com:443

    0 comments No comments