This endpoint is used for retrieving a paginated list of Cases.
You start by sending an initial request with the desired parameters set (Type, Status, Limit, Order).
The response will include metadata such as number of records returned and if there are more records in the direction requested.
The response will include a 'Links' object with 'Next' and 'Previous' links that must be used to get the next or previous page.
If response states there are no more records after using a 'Next-link' you are at the end for now.
The response will still contain a 'Next-link' that may result in more records in the future, depending on sort order.
An endpoint that supports cursor-based pagination always support the following parameters:
| Parameter | Description | Possible Values | Default | Remark |
|---|---|---|---|---|
Limit | Max number of records to be returned on each request. | 1 - 1000 | 100 (if Cursor not set) | Only allowed on initial request (when not using Cursor). |
Order | In what order the records will be returned. The columns that are ordered by may vary between endpoints. | 'ASC', 'DESC' | 'DESC' (if Cursor not set) | Only allowed on initial request (when not using Cursor). |
Cursor | A cursor used to fetch the next/previous set of records. | Next or Previous cursor from an earlier request | NULL | When using a cursor, you can't change the parameters from the initial request. If that is needed, you have to create a new initial request. |
Direction | Whether you want to fetch records after the cursor (next) or before the cursor (prev). | 'NEXT', 'PREV' | NULL | Only allowed when using Cursor. |
A specific endpoint that supports cursor-based pagination may support additional query parameters.
It is not possible to adjust query parameters when using a cursor. If the limit is set to 5, all succeeding cursor-based requests will use the same limit etc. The only allowed parameter to use with Cursor is
Direction.
The response of an endpoint that supports cursor-based pagination will have the form:
{
"result": [
{
//...
},
{
//...
}
],
"pageInfo": {
"recordCount": 2,
"hasMore": true,
"nextCursor": "some-cursor-to-get-next",
"previousCursor": "some-cursor-to-get-previous"
},
"links": {
"self": null,
"next": "/api/v1/cases?cursor=some-cursor-to-get-next&direction=next",
"previous": "/api/v1/cases?cursor=some-cursor-to-get-previous&direction=prev"
}
}Property | Description | Usage |
|---|---|---|
| The actual records requested | |
| The number of records in the Result list | |
| Indicates if there are currently more records to be fetched on the next/previous page. The value is based on the direction of the former request. | If hasMore is false you have reached the current end of the list. Depending on sort order and direction of traversal, there may come more records eventually. |
| Cursor to be used to fetch next records. | Use this with Direction 'NEXT' to get next records - or use the |
| Cursor to be used to fetch previous records. | Use this with Direction 'PREV' to get previous records - or use the |
| Path to use to get the next records. This will be NULL if Result is empty - in that case the former request would have indicated that by setting hasMore to false. | The Cursor and Direction parameter is added in this path already, so this can be used straight away to get the next records. |
| Path to use to get the previous records. This will be NULL if Result is empty - in that case the former request would have indicated that by setting hasMore to false. | The Cursor and Direction parameter is added in this path already, so this can be used straight away to get the previous records. |
