Most of the endpoints of the API returning a large number of resources are paginated. For example, you can list macros, List all rules, etc... These API endpoints share common request parameters and response structures.
Cursor-based pagination
Cursor-based pagination provides lower latency when listing resources. It replaced previous offset-based pagination.
Request parameters:
Parameter | Type | Description |
---|---|---|
cursor | string (Optional) | Value indicating your position in the list of resources. If omitted, the first resources of the list will be returned. E.g: |
limit | integer (Optional) | Maximum number of resources to return. E.g: |
order_by | string (Optional) | Attribute used to order resources. E.g: |
Response attributes:
Attribute | Type | Description |
---|---|---|
data | list | A list of resources. E.g: a list of tickets. |
object | string | The type of the data contained in the |
uri | string | The URL to access the resources requested. E.g: |
meta.prev_cursor | string (Optional) | Cursor to use to fetch the previous resources in the list. E.g: |
meta. next_cursor | string (Optional) | Cursor to use to fetch the next resources in the list. E.g: |
Response example
{
"data": [...]
"object": "list",
"uri": "/api/macros",
"meta": {
"prev_cursor": null,
"next_cursor": "WyJuZXh0IiwgMjksIDkyOV0="
}
}
Offset-based pagination
Offset-based pagination has been deprecated and will become unavailable on Aug 1, 2022. Cursor-based pagination replaced the offset-based pagination. Cursor-based pagination provides lower latency when listing resources.
Request parameters:
Parameter | Type | Description |
---|---|---|
page | integer (Optional) | The index of the page to retrieve. E.g: |
per_page | integer (Optional) | The number of resources to retrieve per request. E.g: |
Response attributes:
Attribute | Type | Description |
---|---|---|
data | list | A list of resources. E.g: a list of tickets. |
object | string | The type of the data contained in the |
current_page | string | The URL to access the resources requested. |
item_count | integer | The total number of resources. E.g: |
next_page | string | The URL to access the next page. |
nb_pages | integer | The total number of pages, based on the given |
page | integer | The index of the page requested. |
per_page | integer | The number of resources to retrieve per request. E.g: |
Response example
{
"data": [...]
"object": "list",
"meta": {
"page": 1,
"per_page": 30,
"current_page": "/api/macros/&page=1",
"item_count": 278,
"nb_pages": 10,
"next_page": "/api/macros/&page=2"
}
}