Skip to main content

List devices

MethodPath
GET/v1/slim/device

Authentication · Access policies

Lists the devices in your project with their zone, location and resident names. Use it for device directory and administration screens.

Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Device:search and Device:read. Scope: the caller's project (from the token).

Behaviour​

  • Every device in the project is listed, whether or not it has a location or resident.
  • id is the Device resource id. thingsboardId is the device identifier that telemetry is keyed by.
  • status is active when the device's live telemetry reports it active, otherwise inactive.
  • lastActivityTime is the latest telemetry activity time, or the device's last-seen time when telemetry has none.
  • search matches device, location and zone names. patientSearch matches resident names. Both are case-insensitive substring matches.
  • organizationId, locationId, patientId and active filter on exact values.
  • Rows with an empty sort value sort last in ASC order and first in DESC order.
  • page is zero-based. count defaults to 20, maximum 100. total is the number of rows after filtering.
  • The device structure is cached for up to 5 minutes. Writes made through the Slim routes refresh it sooner.
  • If the device list cannot be built and no earlier complete list exists, the route returns 503. Retry shortly.

Example​

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/device?page=0&count=20&sortBy=deviceName&orderBy=ASC' \
-H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response​

200 — One page of devices.

Errors​

StatusMeaning
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, you lack Device:search or Device:read, your session has no project, or you cannot access the project.
422A query parameter fails validation.