Getting 504 error while accessing Microsoft graph api.

Dhage, Endraja (CIB Tech, IND) 0 Reputation points
2023-06-21T11:56:16.63+00:00

I am trying to read messages using graph api . some times its work and some times its giving me 504 error

url:

https://graph.microsoft.com/v1.0/users/******@exchaddev.labmorgan.com/mailfolders/inbox/messages?$expand=attachments&?$filter=subject eq 'Test Send Mail'
Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,406 Reputation points
    2023-06-22T09:35:35.5033333+00:00

    Hi @Dhage, Endraja (CIB Tech, IND)

    Looks like a gateway timeout error, which is usually caused by the amount of data being returned.

    User's image

    I suggest you use the $top query parameter to paginate to reduce data concurrency:

    https://graph.microsoft.com/v1.0/users/******@exchaddev.labmorgan.com/mailfolders/inbox/messages?$expand=attachments&$filter=subject eq 'Test Send Mail'&$top=10
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.