Jerin
Jerin

Reputation: 11

Microsoft Teams Direct/Group Chat Messages Retrieval

I have been using "https://graph.microsoft.com/beta/chats/{id}/messages" this Ms-Graph API to retrieve the Chat Messages for (Direct/Group Chat) in Microsoft Teams. I get first set of response (i.e. 20 Messages) but when i try to get the next set of messages using the "@odata.nextLink" property i encountered "Bad Request" error.

Is there any other way to retrieve the Next set of Chat Messages from Group/Direct Chat in Microsoft Teams?

Upvotes: 0

Views: 170

Answers (1)

Jeevan
Jeevan

Reputation: 457

Please use the query parameters $skip in conjunction with $top to have finer control over the result if nextLink is not working ( could be because it's still in Beta). For example, use the below query to get 30 entries after skipping 30 entries

https://graph.microsoft.com/beta/chats/{id}/messages?$top=30&$skip=30

Upvotes: 1

Related Questions