Make paginated requests to the API endpoints
How it works
When you send a request to endpoints that supports pagination, you can use some query parameters that allows you to navigate between pages and limit the data returned per page.
Parameters
page
: Number of the page to navigate to.limit
: The maximum number of results that can be returned on one page.- The default
limit
value is 15. - The maximum
limit
value is 50.
- The default
Response
All endpoints that supports pagination their response body returns an extra object called pagination
.
This object includes the following informations:
{
"data": ["..."],
"pagination": {
"path": "https://api.corporatemerch.com/v1/endpoint", // Full path of the endpoint excluding page parameters
"total": 10, // The total number of data (of all the pages)
"limit": 15, // Limit query parameter
"current_page": 1, // The page currently being requested
"last_page": 2, // The last page
"has_more": true // TRUE means there's more pages that can be requested
}
}