Pagination
Note
Pagination is supported only for “CyberApp Enablement 2.0”. If your callbacks start with cti.a.p.acgw.callback.v1.0,
follow the instructions in the user interface to upgrade your callbacks to the new version.
Callback requests support pagination mechanisms to handle large amount of data efficiently. The pagination method is specified in the CyberApp configuration and can be on of the following:
Cursor-based pagination - the request contains the cursor to the next and/or previous page which encode the filtering information provided by the callback handler.
Offset-based - the request contains the offset index and limit. The callback handler must use it to retrieve the start position according to the offset and return the number of elements specified in the limit.
No pagination - the entire dataset is sent by the callback handler in a single request.
Cursor-based pagination
Request
For cursor-based pagination, the request includes the following fields:
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
The number of entries per page. |
|
string |
No |
A cursor to the next page. Encodes the filtering information provided by the callback handler. |
|
string |
No |
A cursor to the previous page. Encodes the filtering information provided by the callback handler. |
Example request with cursor-based pagination:
{
"type": "cti.a.p.acgw.request.v1.1~vendor.app.list_user_ids.v1.0",
"request_id": "eb768938-dbb6-4a5c-aae1-23cebfac7f26",
"created_at": "0001-01-01T00:00:00Z",
"context": {
"callback_id": "cti.a.p.acgw.callback.v2.0~vendor.app.list_user_ids.v1.0",
"endpoint_id": "cti.a.p.acgw.endpoint.v1.0~vendor.app.endpoint.v1.0",
"tenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"datacenter_url": "https://eu8.acronis.cloud"
},
"payload": {},
"paging": {
"limit": 5,
"after": "eyJpZCI6MTIzfQ=="
}
}
Response
For cursor-based pagination, the response must include the following fields:
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
A cursor to the next page, if present. |
|
string |
No |
A cursor to the previous page, if present. |
|
integer |
Yes |
The total number of entries. |
Example response with cursor-based pagination:
{
"type": "cti.a.p.acgw.response.v1.1~vendor.app.list_user_ids.ok.v1.0",
"request_id": "eb768938-dbb6-4a5c-aae1-23cebfac7f26",
"response_id": "6eb3efde-8071-40ab-b820-6e749a2dafd6",
"payload": [
"9ef1b9d2-beb2-4fe8-b4a0-2f8018dcc519"
],
"paging": {
"after": "eyJpZCI6MjAwfQ==",
"before": "eyJpZCI6MTAwfQ==",
"total_count": 6
}
}
Offset-based pagination
Request
For offset-based pagination, the request includes the following fields:
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
The number of entries to return. |
|
integer |
No |
The offset index that specifies the start position. Defaults to 0 if not specified. |
Example request with offset-based pagination:
{
"type": "cti.a.p.acgw.request.v1.1~vendor.app.list_user_ids.v1.0",
"request_id": "eb768938-dbb6-4a5c-aae1-23cebfac7f26",
"created_at": "0001-01-01T00:00:00Z",
"context": {
"callback_id": "cti.a.p.acgw.callback.v2.0~vendor.app.list_user_ids.v1.0",
"endpoint_id": "cti.a.p.acgw.endpoint.v1.0~vendor.app.endpoint.v1.0",
"tenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"datacenter_url": "https://eu8.acronis.cloud"
},
"payload": {},
"paging": {
"limit": 5,
"offset": 5
}
}
Response
For offset-based pagination, the response must include the following fields:
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
The offset of the first returned item. |
|
integer |
Yes |
The total number of entries. |
Example response with offset-based pagination:
{
"type": "cti.a.p.acgw.response.v1.1~vendor.app.list_user_ids.ok.v1.0",
"request_id": "eb768938-dbb6-4a5c-aae1-23cebfac7f26",
"response_id": "6eb3efde-8071-40ab-b820-6e749a2dafd6",
"payload": [
"dfadc511-679b-4d0e-8ffd-f04dde8b2030"
],
"paging": {
"offset": 5,
"total_count": 6
}
}
No pagination
If pagination is not supported or configured for a callback, the paging field will not be included in the request, and the callback handler should return all available data in a single response.
Example request without pagination:
{
"type": "cti.a.p.acgw.request.v1.1~vendor.app.list_user_ids.v1.0",
"request_id": "eb768938-dbb6-4a5c-aae1-23cebfac7f26",
"created_at": "0001-01-01T00:00:00Z",
"context": {
"callback_id": "cti.a.p.acgw.callback.v2.0~vendor.app.list_user_ids.v1.0",
"endpoint_id": "cti.a.p.acgw.endpoint.v1.0~vendor.app.endpoint.v1.0",
"tenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"datacenter_url": "https://eu8.acronis.cloud"
},
"payload": [
"70474814-600e-4a6d-9838-983a6eb5efd5",
"e3ef73d5-72be-4376-b855-ebe346613d9f",
"9165a742-a1df-4dbf-9eb7-23d7e391b72b",
"fc61ba4e-7094-423a-bd4c-db475e46bbf4",
"9ef1b9d2-beb2-4fe8-b4a0-2f8018dcc519",
"dfadc511-679b-4d0e-8ffd-f04dde8b2030"
]
}