Some resources can return a large number of records. When returning responses from these resources, the Uberflip API will paginate the response, splitting the returned records into separate pages. Each request will return a single page, consisting of a specified number of records.
Request Parameters
When you make a request to a resource that returns paginates records, there are two request parameters that you can use to control the pagination: limit
and page
.
The limit
parameter determines how many records will be included on a page. By default the API will include 25 records per page (unless otherwise specified for the particular resource). You can change the number of records per page to any number between 1 and 100.
The page
parameter specifies the page number to return. For example, if the limit
parameter is set to 100
(i.e. 100 results per page), setting page
parameter to 3
will return the third page of 100 records per page, i.e. records 201-300.
Request Parameter | Description |
---|---|
limit | Specifies the number of records to return per page. |
page | Specifies the page to return (one page returned per request). |
Response Parameters
When the API returns a paginated response, the response body will contain data
and meta
parameters.
The data
parameter contains an array of the requested records.
The meta
parameter contains an object that provides information about the pagination, such as the total number of pages that can be returned based on the specified limit
value, and URLs to request the previous and next pages (if applicable):
Response Parameter | Description |
---|---|
data | An array consisting of the requested number of records on the specified page. |
meta | An object containing metadata about the pagination of the request. |
Property | Type | Description |
---|---|---|
count | integer | The total number of records that the resource can return. |
limit | integer | The value of limit specified in the request, i.e. the number of records that the API has returned for this request. |
total_pages | integer | The total number of pages that would be required to return all records, assuming the same value of limit specified for this request. |
prev_page | string | The URL pointing to the previous page, assuming the same value of limit specified for this request. Not returned if no previous page is available. |
next_page | string | The URL pointing to the next page, assuming the same value of limit specified for this request. Not returned if no next page is available. |
Example
curl -H "Authorization: Bearer [Token]" \
-i https://v2.api.uberflip.com/hubs?limit=2&page=2
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
{
...
},
{
...
}
],
"meta": {
"count": 6,
"limit": 2,
"total_pages": 3,
"previous_page": "https://v2.api.uberflip.com/hubs?limit=2&page=1",
"next_page": "https://v2.api.uberflip.com/hubs?limit=2&page=3"
}
}