Pagination

Endpoints that have the potential to return a large number of items may be paginated. In order to maintain consistency, they will share common request parameters and response structures. The response will also contain the properties of the Application Response Object and the list of items will appear in the payload of that object.

📘

Paginated endpoints may have other filters based on the objects they would be retrieving. The request parameters on this page are the generic items that all paginated endpoints will be using.

Request Parameters

Parameter NameTypeDescription
pageSizelongNumber of items per page. Max page size is 100.
pageNumberlongThe index of the page to retrieve. Default value is 1.

Response Properties

PropertiesTypeDescription
firstPagestringThe URL of the first page of the list of pages.
nextPagestringThe URL of the next page in the list of pages.
previousPagestringThe URL of the previous page in the list of pages.
lastPagestringThe URL of the last page in the list of pages.
pageSizelongNumber of items per page.
pageNumberlongThe page number of the current page.
totalRecordslongThe total number of items across all pages.
totalPageslongThe total number of all pages.

Example of Response with values

{
  "pageNumber": 1,
  "pageSize": 10,
  "firstPage": "http://api.alocity.com/v1/integration-management/devices?pageNumber=1&pageSize=10",
  "lastPage": "http://api.alocity.com/v1/integration-management/devices?pageNumber=1&pageSize=10",
  "totalPages": 1,
  "totalRecords": 2,
  "nextPage": null,
  "previousPage": null,
  "applicationEvents": [
    {
      "type": "Info",
      "code": "succeed_system_operation",
      "message": "Device page.",
      "parameter": null
    }
  ],
  "payload": [
    {
      "accountId": 4,
      "createdAt": "2022-04-25T15:33:56.29",
      "name": "Device 01",
      "serialNumber": "3C62F0077752-1254DLT000157"
    },
    {
      "accountId": 4,
      "createdAt": "2022-01-27T17:51:25.383",
      "name": "Device 02",
      "serialNumber": "3C62F0079T7F-1255DLT000134"
    }
  ],
  "hasErrors": false
}