Share via

MSTeams Graph API: Gateway timeout error when querying direct messages

Tarun George Koshy 71 Reputation points
2022-04-05T06:05:23.56+00:00

Hi,

While querying the getAllMessages endpoint (chats-getallmessages) a Gateway timeout error response is being thrown. The "code" returned is "Unknown error". The query parameters that were added to getAllMessages are: "?model=B&$top=1000"

Below is the error response:

Gateway Timeout

{    
  "code": "UnknownError",   
    "message": "",    
    "innerError": {      
     "date": "2022-03-30T23:41:48",      
     "request-id": "2551eebe-0f44-4f56-a474-aaa8f81213f1",..  
 }  

Thanks

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
0 comments No comments

1 answer

Sort by: Most helpful
  1. HarmeetSingh7172 4,831 Reputation points
    2022-04-05T10:14:31.823+00:00

    Hi @Tarun George Koshy

    GetAllMessages API is not supported in delegated Context. If you are using Application permissions to get all the messages across all chats, it requires additional validation as this particular API comes under Protected APIs. To request access for this protected API, you need to submit the request and get approval.

    Documentation reference- https://learn.microsoft.com/en-us/graph/teams-protected-apis

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

    Was this answer helpful?


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.