PaginationΒΆ
Any GET request can be paginated by adding the parameters limit and offset to the current parameter list.
Parameters:
Field |
Explanation |
|---|---|
offset |
Defines the start position of the data returned |
limit |
Limits the number of results returned |
Response HTTP Headers:
Header |
Explication |
|---|---|
X-Page |
Current page |
X-Per-Page |
Elements by page |
X-Total |
Elements total |
X-Total-Pages |
Pages total |
An example (using the /templates call) could be like this:
curl --include --request GET \
--url 'https://api.gigas.com/account/ACCOUNT_ID/templates?offset=0&limit=3' \
--header 'Authorization: apitoken' \
--header 'Content-Type: application/json'
The response includes the pagination metadata in the HTTP headers:
HTTP/1.1 200 OK
X-Total: 46
X-Total-Pages: 16
X-Per-Page: 3
X-Page: 1
To fetch the next page, increment offset by the value of limit:
curl --include --request GET \
--url 'https://api.gigas.com/account/ACCOUNT_ID/templates?offset=3&limit=3' \
--header 'Authorization: apitoken' \
--header 'Content-Type: application/json'