# How to paginate?

**URL:** <https://community.sendbird.com/t/how-to-paginate/5308>\
**Category:** Flutter\
**Tags:** chatsdk\
**Created:** [August 11, 2022, 4:03am UTC](https://community.sendbird.com/t/how-to-paginate/5308 "2022-08-11T04:03:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arone\_Jerome](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Arone\_Jerome](https://community.sendbird.com/u/Arone_Jerome)\
**Post date:** [August 11, 2022, 4:03am UTC](https://community.sendbird.com/t/how-to-paginate/5308/1 "2022-08-11T04:03:03Z")

</div>

Im confused. How to use pagination? do I need to add token to get the next page? where can i get the token.

---

<div class="post-metadata">

**Author:** ![Chinmaya\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/chinmaya_gupta/32/1021_2.png) [@Chinmaya\_Gupta](https://community.sendbird.com/u/Chinmaya_Gupta)\
**Post date:** [August 11, 2022, 5:18am UTC](https://community.sendbird.com/t/how-to-paginate/5308/3 "2022-08-11T05:18:13Z")

</div>

Hello, @Arone_Jerome Welcome to the Sendbird community!

Yes, you need to add a token parameter. Consider the below example:

Platform API allows you to get the list of all your channels.

Call GET → [https://api-{](https://api-%7B/)application\_id}.[sendbird.com/v3/group\_channels/?limit=100&show\_members=true](https://sendbird.com/v3/group_channels/?limit=100&show_members=true)

Reference: [Overview | Chat Platform API | Sendbird Docs](https://sendbird.com/docs/chat/v3/platform-api/guides/group-channel#2-list-channels-3-http-request)

This will get 100 channels. If you have more than 100, then Sendbird will send you a “next” attribute: something like this

“next”: “ZnsURFdUQVJHXERECA0cTj0tTBwCChxxxxxx”

This means that you still have more information to retrieve. You need to call the same URL again but adding a “token” parameter.

GET → [https://api-{](https://api-%7B/)application\_id}.[sendbird.com/v3/group\_channels/?limit=100&show\_members=true&token=ZnsURFdUQVJHXERECA0cTj0tTBwCChxxxxxx](https://sendbird.com/v3/group_channels/?limit=100&show_members=true&token=ZnsURFdUQVJHXERECA0cTj0tTBwCChxxxxxx)

And you get the list of the following channels. Once the “next” attribute is empty, it means that you received all the information and there’s nothing more to get.

“next”:“”

Let me know if this helps.

---

<div class="post-metadata">

**Author:** ![Arone\_Jerome](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Arone\_Jerome](https://community.sendbird.com/u/Arone_Jerome)\
**Post date:** [August 11, 2022, 5:20am UTC](https://community.sendbird.com/t/how-to-paginate/5308/4 "2022-08-11T05:20:48Z")

</div>

Hi @Chinmaya_Gupta .But i’m using the package sendbird\_sdk for flutter. Do I still need to do API request before getting the next page of GroupChannelListQuery() ?

---

<div class="post-metadata">

**Author:** ![Arone\_Jerome](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Arone\_Jerome](https://community.sendbird.com/u/Arone_Jerome)\
**Post date:** [August 11, 2022, 5:50am UTC](https://community.sendbird.com/t/how-to-paginate/5308/5 "2022-08-11T05:50:45Z")

</div>

Hello, I think I got it na. My mistake is adding the GroupChannelListQuery() inside the action. The loadNext() is always getting a new instance. We should put it outside so that the .loadNext() function will get the next set of data. Thanks for your time @Chinmaya_Gupta
