Pagination and language
How list endpoints page their results and how to request translated content.
Pagination
List endpoints take two query parameters.
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | The page of results to return. The first page is 1. |
pageSize | integer | 25 | The number of results per page. |
curl "$ONEBASKET_API_URL/kiosks?page=2&pageSize=50" \
-H "x-api-key: $ONEBASKET_API_KEY"Response shape
The Seating, Kiosks and Timestreams APIs return this envelope:
{
"page": 2,
"pageSize": 50,
"pageTotal": 4,
"resultsTotal": 180,
"hasNextPage": true,
"hasPreviousPage": true,
"results": []
}| Field | Description |
|---|---|
page | The current page of results. |
pageSize | The number of results per page. |
pageTotal | The total number of pages. |
resultsTotal | The total number of results. |
hasNextPage | true if there is a next page. |
hasPreviousPage | true if there is a previous page. |
results | The results for the current page. |
Search products in the Catalogues API returns a different envelope: results, page, pageSize, totalResults, preOrderCount and comingSoonCount. To find out whether there is a next page, compare page * pageSize with totalResults.
Language
The Catalogues API returns translated product content. Send the language you want in the Accept-Language header. The default is en.
curl "$ONEBASKET_API_URL/catalogues/products" \
-H "x-api-key: $ONEBASKET_API_KEY" \
-H "Accept-Language: ar"The languages available depend on how the store and its providers are configured.