All API resources have support for bulk fetches via "list" API methods.
For instance, you can list conversations, list channels, list templates, list contacts, and so on. These list API methods share a common structure, taking at least these three parameters: limit
, before
, and after
.
In responses for list API-calls you find a pagination object. This object always holds a next and previous cursor id, as well as a next and previous URL. Feel free to use what better fits your needs.
An example of the pagination object is like so:
"pagination": {
"next_cursor": "ct_23091u03neln34043f0n",
"next_url": "/contacts?limit=50&after=ct_23091u03neln34043f0n",
"previous_cursor": "ct_38494rf30f3ncfn3493n",
"previous_url": "/contacts?limit=50&before=ct_38494rf30f3ncfn3493n"
}