Compare device sleep status with ingest logs
| Method | Path |
|---|---|
GET | /v1/slim/device/live/cloudwatch/:deviceId |
Authentication · Access policies
Computes a Sleepiz device's away, awake or asleep status from the raw readings in the ingest logs, and compares it with the status the live telemetry shows. Use it to check whether the live status is in sync.
Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Device:read, Observation:search and Observation:read.
Scope: the device must be visible to your token and belong to the caller's project or one of its sub-projects.
Behaviour
deviceIdis the device serial, letters, digits,_and-only.- Only readings from the last 12 hours are read, at most 1000 log entries, newest first.
statusisdisconnectedwhen no presence or sleep reading is found in that window.presenceandsleephold the latest reading of each kind with its original Observation, ornull.comparisonsets the log status beside the live telemetry status.statusChangeLatencyMsis set when both agree, andstalenessMswhen they differ.- When the live status cannot be read,
comparison.telemetryErrorholds the reason and the rest of the response is still returned. - Read-only.
Example
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/device/live/cloudwatch/3001000' \
-H "Authorization: Bearer ${OVOK_TOKEN}"
Successful response
200 — Sleep status from the ingest logs, compared with the live telemetry.
Errors
| Status | Meaning |
|---|---|
401 | Bearer token is missing, invalid or expired. |
403 | You are not a practitioner, admin or System Owner, you lack Device:read, Observation:search or Observation:read, your session has no project, or no device with this serial is visible in your project. |
422 | deviceId contains characters other than letters, digits, _ and -. |