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 Name

Type

Description

pageSize

long

Number of items per page. Max page size is 100.

pageNumber

long

The index of the page to retrieve. Default value is 1.

Response Properties

Properties

Type

Description

firstPage

string

The URL of the first page of the list of pages.

nextPage

string

The URL of the next page in the list of pages.

previousPage

string

The URL of the previous page in the list of pages.

lastPage

string

The URL of the last page in the list of pages.

pageSize

long

Number of items per page.

pageNumber

long

The page number of the current page.

totalRecords

long

The total number of items across all pages.

totalPages

long

The 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
}