OTA Connect API Usage Guide

Understanding pagination

Many API endpoints in OTA Connect have paginated responses, where the API returns an object that contains the set of results as an array, as well as some information about the current page of results. Pagination is used when calling endpoints that could potentially return very long lists of items—​for example, getting a list of all your devices.

When you call a paginated endpoint, you’ll get the first 50 results by default, along with pagination information:

{
  "values": [],
  "total": 2386,
  "offset": 0,
  "limit": 50
}
Field Type Description

values

Array

The actual values returned for the current page. This will be an empty array if there are no results.

total

Integer

The total number of values available in the API.

offset

Integer

The zero-indexed offset for the current page. For example, with an offset of 150, your values array will begin at the 151st element.

You can include offset and limit as query parameters to receive the different pages of the list. For example, to receive the 51st-100th most recently created devices via cURL, you could do this:

curl "https://api.ota.here.com/v1alpha/devices?offset=50&limit=50" -H "accept: application/json" -H "Authorization: Bearer $ota_token" | jq .