Skip to content

Pagination

Reference
For:
Developers

REST API pagination in ReputeCast depends on the list: most lists take page and pageSize, logs and activity feeds take a cursor, and a few take a time or an offset. Each operation’s page in the API reference shows its parameters; this page groups them by style. Lists in responses are never null: an empty list is [].

Send page (from 1, default 1) and pageSize. The response has items, total (items that match your filters), page and pageSize, often next to summary fields such as counts.

Terminal
curl -s -H "Authorization: Bearer $RC_KEY" \
"$RC_URL/api/v1/workspaces/acme-newsletter/campaigns?status=sent&page=2&pageSize=50"
  • You have every item when page × pageSize ≥ total.
  • A page past the end answers 200 with "items": [].
  • Send the same filters with every page.
Operation Default pageSize Largest pageSize
list-campaigns 25 100
list-contacts 10 100
list-suppressions 10 100
list-provider-events 25 100
list-product-orders 10 100
list-paid-members 8 100
list-payment-events 8 100

A few lists take page alone and choose the page size themselves: list-gifts (20 gifts a page), list-referrers, get-partner-requests, list-sms-suppressions and list-sms-events.

Send limit, then pass the cursor from the previous answer as cursor to get the next page. The cursor is opaque: store it as it is. On the last page the cursor field is left out.

Terminal
curl -s -H "Authorization: Bearer $RC_KEY" \
"$RC_URL/api/v1/workspaces/acme-newsletter/audit?limit=200&cursor=<nextCursor from the previous page>"
Operation Cursor field in the answer Default limit Largest limit
list-audit-events nextCursor, with total 50 200
contact-activity nextCursor, with total 8 100
list-ai-activity next 50 100
list-store-activity next 25 100
list-store-products next (a number), with total 48 100

Logs that grow while you read them page backwards in time, newest first.

Operation How to get the next page Default limit Largest limit
list-transactional-messages Pass the answer’s next as before 25 100
list-conversions Pass the answer’s next (a time) as before 50 200
list-whatsapp-events Pass the answer’s next (a time) as before 50 200
list-push-events When more is true, pass the time of the last event as before 50 200

list-transactional-messages also takes after: pass a page’s newest value to get only the messages that arrived since, for a live view.

Send offset (the number of items to skip, from 0) and limit.

Operation Default limit Largest limit
list-integration-calls 20 100 (offset up to 10,000)
list-poll-comments 20 100
list-survey-responses 20 100
list-survey-text-answers 20 100
list-sms-replies 50 100

These answer up to limit items and have no further pages: list-webhook-deliveries (50, up to 200), list-media (200, up to 500), list-campaign-versions (50, up to 300) and list-agent-actions (20, up to 100). Lists that take no paging parameter at all, such as list-lists and list-segments, answer every item at once.

  • A value above the largest allowed answers 422 with the code validation_failed and the parameter in errors[].location, for example query.pageSize (see errors).
  • Every page counts as one request against the rate limits. Ask for the largest page you can use instead of many small ones.
  • To follow changes without paging through lists again, receive webhooks.