How to paginate through a long list of records returned by a Messaging API ?

Most of the Messaging APIs support pagination to fetch a long list of records returned in the GET request.

The following two query parameters can be used for the same.

Limit query param determines how many records can be fetched at a time. 

Offset query param is used to specify the offset of the record to fetch. Offset starts from 0 until (total records -1).

For example to fetch all sender Ids configured under the account we invoke the following API

The API response payload returns the total count at the end. That can be used to pro grammatically determine the next sequence of calls needed to fetch all the data.

For example, if we the total count is 210 

We would call the following APIs requests for fetching all of them.   [return 100 records, with offset 0 – 99] [return 100 records, with offset 100 – 199] [return 10 records, with offset 200 – 209]



Was this article helpful?
0 out of 0 found this helpful


Please sign in to leave a comment.