Forum Discussion

BoHyun's avatar
BoHyun
Brass Contributor
Sep 03, 2020
Solved

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

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.

 

  • 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

  • Mayur3399's avatar
    Mayur3399
    Copper Contributor

    Can you try 

    await graphClient.Teams[teamId].Channels[channel.Id].Messages[chatId].Replies.WithUrl(OdataNextLink).GetAsync()
  • 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

    • DanLepage's avatar
      DanLepage
      Copper Contributor

      Trinetra-MSFT 

      Hi, this documentation simply states that it gives a skipToken but does not provide any information on how to use it in C#.

       

      Is there any examples of how to implement it?

Resources