Microsoft Graph API - 如何使用 'skiptoken'

Microsoft Graph API - How can I use 'skiptoken'

正在给某个团队的频道ID带来消息和回复。

使用这个,

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

如果我们得到超过 50 个结果,它 returns @odata.nextLink 包含 'skiptoken'

像这样..

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

但我想做的是在 c# 代码中使用 'skiptoken'。

我试过了,

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

此代码returns错误。

如何使用 'skiptoken'?请帮我。 谢谢。

您可以使用下面的代码。

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();