Pagination

Requests that return multiple items return up to 50 items per page. If there are more than 50 items, each results page includes pagination links to subsequent pages in both the header and the JSON body. Following the provided rel links instead of constructing your own pagination URLs reduces errors and guarantees that each pagination request contains relevant content.

Link Header

Pagination information is included in the Link header according to RFC 5988.

Link: <https://api.armadill.io/v2.0/companies/name={name}&page=2>; rel="next",
  <https://api.armadill.io/v2.0/companies?name={name}&?page=6>; rel="last"

Link JSON

Pagination information is included in JSON body in the pagination key.

"pagination": {
    "next": "https://api.armadill.io/v2.0/companies?name={name}&page=2",
    "last": "https://api.armadill.io/v2.0/companies?name={name}&?page=6"
}

rel Values

RelDescription
nextThe link relation for the immediate next page of results.
previousThe link relation for the immediate previous page of results.
firstThe link relation for the first page of results.
lastThe link relation for the last page of results.

Additional headers

The number of results and the number of pages is included in the header.

X-TotalCount: 300,
X-PerPage: 50

Additional JSON data

The number of results and the number of pages is included in the JSON body in the pagination key.

"pagination": {
	 "totalCount": 300,
   "perPage": 50 
}

Empty results

When no results are returned from the search, an empty structure is returned.

"pagination": {
	 "totalCount": 0,
   "perPage": 0
}