Pagination
Walk through long lists in the BoxHero API with cursor-based pagination.
List endpoints return results one page at a time and use cursor-based pagination.
Query parameters
Section titled “Query parameters”| Parameter | Description |
|---|---|
cursor | Where the page starts. Pass the cursor field from the previous response. Omit it on the first call. |
limit | Page size. The allowed range and the default are listed with each endpoint, for example List items. |
Response
Section titled “Response”Each page carries the results with the fields you need to fetch the next one:
{ "items": [...], "count": 100, "limit": 100, "cursor": 1234567, "has_more": true}| Field | Description |
|---|---|
count | Number of results on this page |
limit | Page size used for this page |
cursor | Pass this as the cursor query parameter to get the next page. null when there are no more pages. |
has_more | true if there are more results after this page |
Fetching every page
Section titled “Fetching every page”- Call the list endpoint without
cursor. - While
has_moreistrue, call it again withcursorset to thecursorfrom the last response. - Stop when
has_moreisfalse.
curl "https://rest.boxhero-app.com/v1/items?cursor=1234567" \ -H "Authorization: Bearer $BOXHERO_API_TOKEN"Keep any filters you used on the first call the same on every following call.
Ordering
Section titled “Ordering”Each resource defines its own order. Most list endpoints return results by id, ascending. List transactions returns the newest transactions first (by transaction time, with id as the tiebreaker).