# Get last-received observation ids for a device

Canonical page: https://docs.ovok.com/slim-apis/telemetry/get-last-received-observation-ids-for-a-device

| Method | Path |
| --- | --- |
| `GET` | `/v1/slim/telemetry/:deviceId/lastIds` |

[Authentication](/authentication) · [Access policies](/access-policies)

Returns, for one device, the ids of the most recent Observations received for heart rate, respiratory rate, sleep status and presence, plus the latest batch. Unlike `effectiveIds`, these change on every reading, whether or not the displayed value changed.

**Auth:** bearer token. The caller must be a practitioner, an admin or a System Owner, and needs `Device:read`.
**Scope:** a device identifier only resolves when the device is visible to your token and in the caller's own project (sub-projects are not included).

## Request [#request]

### Path parameters [#path-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `deviceId` | `string` | Yes | Device identifier (for example `Demo/3001000`) or Device resource id (UUID). Encode the `/` of an identifier as `%2F`. |

## Behaviour [#behaviour]

- `deviceId` is either the device identifier or the Device resource id (a UUID).
- Each field is an Observation id, or `null` when nothing has been received for it yet.
- Only devices whose readings carry their own Observation id fill these fields. For other devices every field is `null`.
- A device that is not found, or not in your project, returns every field `null`, not an error.
- Lookups of a device are cached for up to 10 minutes, and misses for 30 seconds.

## Example [#example]

```bash
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/telemetry/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21/lastIds' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — Last-received observation ids for the device.

```json
{
  "heartRate": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b41",
  "respiratoryRate": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b42",
  "sleepStatus": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b43",
  "presenceStatus": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b44",
  "batch": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b45"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `heartRate` | `string \| null` | Id of the latest Observation received for heart rate. `null` when none has been recorded yet. |
| `respiratoryRate` | `string \| null` | Id of the latest Observation received for respiratory rate. `null` when none has been recorded yet. |
| `sleepStatus` | `string \| null` | Id of the latest Observation received for sleep status. `null` when none has been recorded yet. |
| `presenceStatus` | `string \| null` | Id of the latest Observation received for presence. `null` when none has been recorded yet. |
| `batch` | `string \| null` | Id of the latest batch of readings received. `null` when none has been recorded yet. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`401`](/errors/unauthenticated) | Bearer token is missing, invalid or expired. |
| [`403`](/errors/forbidden) | You are not a practitioner, admin or System Owner, or you lack `Device:read`. |
| [`503`](/errors/service-unavailable) | The access policy cannot be read right now. Retry shortly. |
