SOLVED

Microsoft Graph API - How can I use 'skiptoken' in c#

%3CLINGO-SUB%20id%3D%22lingo-sub-1630431%22%20slang%3D%22en-US%22%3EMicrosoft%20Graph%20API%20-%20How%20can%20I%20use%20'skiptoken'%20in%20c%23%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1630431%22%20slang%3D%22en-US%22%3E%3CP%3EGreetings.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIt%20is%20bringing%20messages%20and%20replies%20to%20certain%20team's%20channel%20ID.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Euse%20this%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fteams%2F%7BteamId%7D%2Fchannels%2F%7BchannelId%7D%2Fmessages%2F%7BmessageId%7D%2Freplies%3F%24top%3D50%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20we%20get%20more%20than%2050%20results%2C%20i%3C%2FSPAN%3Et%20returns%20%40odata.nextLink%20contains%20'skiptoken'%3C%2FP%3E%3CP%3Elike%20this..%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fteams%2F%7BteamId%7D%2Fchannels%2F%7BchannelId%7D%2Fmessages%2F%7BmessageId%7D%2Freplies%3F%24top%3D50%26amp%3B%24skiptoken%3DABCDEFG1234%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20What%20I%20want%20to%20do%20is%20to%20use%20'skiptoken'%20in%20c%23%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Evar%20replies%20%3D%20await%20graphClient.Teams%5BteamId%5D.Channels%5Bchannel.Id%5D.Messages%5BchatId%5D.Replies%0A.Request()%0A.Top(50)%0A.Skiptoken(skiptoken)%0A.GetAsync()%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20code%20returns%20an%20error.%3C%2FP%3E%3CP%3E-%20IChatMessageRepliesCollectionRequest%20does%20not%20include%20a%20definition%20of%20'skiptoken'.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20use%20'skiptoken'%3F%20Please%20help%20me.%3CBR%20%2F%3EThanks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1630431%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EChat%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMessages%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EReplies%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1643142%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Graph%20API%20-%20How%20can%20I%20use%20'skiptoken'%20in%20c%23%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1643142%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F774032%22%20target%3D%22_blank%22%3E%40BoHyun%3C%2FA%3E%26nbsp%3B%2C%3CSPAN%3EThe%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3E%24skiptoken%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3Bparameter%20contains%20an%20opaque%20token%20that%20references%20the%20next%20page%20of%20results%20and%20is%20returned%20in%20the%20URL%20provided%20in%20the%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3E%40odata.nextLink%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3Bproperty%20in%20the%20response.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EPlease%20check%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fquery-parameters%23skiptoken-parameter%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edocumentation%3C%2FA%3E%20for%20more%20information%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Greetings.

 

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.

 

1 Reply
best response confirmed by BoHyun (Contributor)
Solution

@BoHyun ,The $skiptoken parameter contains an opaque token that references the next page of results and is returned in the URL provided in the @odata.nextLink property in the response.

Please check this documentation for more information

www.000webhost.com