# About query messages?

**URL:** <https://forum.social.plus/t/about-query-messages/1268>\
**Category:** General\
**Created:** [April 17, 2024, 2:04pm UTC](https://forum.social.plus/t/about-query-messages/1268 "2024-04-17T14:04:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hossam](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hossam](https://forum.social.plus/u/hossam)\
**Post date:** [April 17, 2024, 2:04pm UTC](https://forum.social.plus/t/about-query-messages/1268/1 "2024-04-17T14:04:52Z")

</div>

Hello and I have another question related to query messages I didn’t need to make pagination just want to get all messages and when I make it without send any thing related to the pagination I got only 20 messages!! so How can make what I told to you ?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [April 17, 2024, 4:15pm UTC](https://forum.social.plus/t/about-query-messages/1268/2 "2024-04-17T16:15:06Z")

</div>

Hello, the maximum number of messages you can retrieve within one call is 100 - unfortunately, retrieving all messages in one call is not possible. Pagination is still required.

You can include options[limit]=100 in the request. Please refer to the sample below:

[https://apix.sg.amity.co/api/v3/messages?options[limit]=100&channelId=testtest](https://apix.sg.amity.co/api/v3/messages?options%5Blimit%5D=100&channelId=testtest)

---

<div class="post-metadata">

**Author:** ![hossam](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hossam](https://forum.social.plus/u/hossam)\
**Post date:** [April 19, 2024, 1:13am UTC](https://forum.social.plus/t/about-query-messages/1268/3 "2024-04-19T01:13:41Z")

</div>

Thank you for that **First** I already put the options[limit]=100 and still retrieve 20 messages only !! and **second question** If my position in the first message of the the retrieved data How can get the messages before this message ?  
and if my position in the end message of the retrieved data how can get the messages after this message?  
and How can know that new message are come?

**Please I need the help for answering that because this is mandatory for me so please give me every steps should do to make that with example please**

I using you API Services

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [April 19, 2024, 12:56pm UTC](https://forum.social.plus/t/about-query-messages/1268/4 "2024-04-19T12:56:32Z")

</div>

Hello, could you please assist by providing your sample curls that you use ‘limit’ to our support team email: [support.asc@amity.co](mailto:support.asc@amity.co)?

Regarding the position, you can handle pagination using tokens. Please refer to the documentation on how to retrieve the the value by using the pagination: [https://docs.amity.co/technical-faq#how-can-i-retrieve-the-next-page-of-data-from-an-api](https://docs.amity.co/technical-faq#how-can-i-retrieve-the-next-page-of-data-from-an-api)

If the position is in the first message, you can use the ‘_prev_’ token. If the position is in the last message, you can use the ‘_next_’ token.

 ![Screenshot 2567-04-19 at 13.53.58](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/fbc07379c18b98e45cb627df66c42dd61c2b1314.png)

---

<div class="post-metadata">

**Author:** ![hossam](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hossam](https://forum.social.plus/u/hossam)\
**Post date:** [April 22, 2024, 8:24am UTC](https://forum.social.plus/t/about-query-messages/1268/5 "2024-04-22T08:24:31Z")

</div>

Can I use next or prev without after and before ?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [April 22, 2024, 10:39am UTC](https://forum.social.plus/t/about-query-messages/1268/6 "2024-04-22T10:39:09Z")

</div>

@hossam Yes, you can use next or prev without after and before.
