简体   繁体   中英

Microsoft Graph API - How can I use 'skiptoken'

It is bringing messages and replies to certain team's channel ID.

use this,

https://graph.microsoft.com/beta/teams/{teamId}/channels/{channelId}/messages/{messageId}/replies?$top=50

If we get more than 50 results, it returns @odata.nextLink contains 'skiptoken'

like this..

https://graph.microsoft.com/beta/teams/{teamId}/channels/{channelId}/messages/{messageId}/replies?$top=50&$skiptoken=ABCDEFG1234

But What I want to do is to use 'skiptoken' in c# code.

I tried,

 var replies = await graphClient.Teams[teamId].Channels[channel.Id].Messages[chatId].Replies
           .Request()
           .Top(50)
           .Skiptoken(skiptoken)
           .GetAsync();

This code returns an error.

  • IChatMessageRepliesCollectionRequest does not include a definition of 'skiptoken'.

How can I use 'skiptoken'? Please help me. Thanks.

You can use the below code.

var queryOptions = new List<QueryOption>() 
{ 
new QueryOption("$skiptoken", "MSwwLDE1OTgwMzU4MTE4OTQ") 
}; 
var replies = await graphClient.Teams["d3b31e36-d63d-4bbe-9478-b4cc7cb17a3d"].Channels["19:342b9f379eb340048b16d9859d9e3712@thread.tacv2"].Messages["1598032654892"].Replies 
.Request(queryOptions) 
.GetAsync();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM