SlimSlim/Device

List projects for device assignment

  • Sandbox: available
  • Staging: available
  • Production: unknown
GET
/v1/slim/device/assign/project

Lists the projects you can move a device into: your own project, its parent project and its sub-projects.

Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Device:update. Scope: the caller's project (from the token) and its parent and sub-projects.

Behaviour

  • Each entry is { project: { id, name } }. name is an empty string when the project has none.
  • total is the number of projects returned.
  • Read-only.

Example

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/device/assign/project' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'

Authorization

bearer
headerAuthorizationBearer <JWT>

Response Body

Projects a device can be moved into.

application/json
  1. response
total*integer

Number of projects returned.

Range0 <= value
resources*array<>
Example Request
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/device/assign/project'
Example Response
{  "total": 0,  "resources": [    {      "project": {        "id": "string",        "name": "string"      }    }  ]}

List change history GET

Lists the recorded changes to thresholds, locations, zones, devices, residents, and users and their roles in your project, newest first. Use it for the resident and administration change-history screens. **Auth:** bearer token. The caller must be a practitioner, an admin or a System Owner, and needs `Provenance:read`. Only the Admin and System Owner access policies carry it, so other users get no change history. **Scope:** the caller's project (from the token). The rows are read with your token, so you only see changes recorded in your project. ## Behaviour - Each row is one recorded change. `details.key` names the change and `details.values` holds the values to put into its message. - Rows are sorted by recording time, newest first. `sort=asc` returns the same rows oldest first. Rows recorded in the same millisecond keep one fixed order, so paging never skips or repeats a row. - Without `startDate`, the list starts 30 days before now. `endDate` is optional. Both bounds are inclusive. - `types` limits the rows to the given change types. Omit it to get every type. Repeat the parameter to pass several types. - `scope=global` keeps only project-wide changes: organization threshold edits, device, location and zone lifecycle changes, and user and role changes. `scope=all` (the default) returns every row. - `types=Access` lists the user and role changes: a user invited (`userInvited`), renamed (`userRenamed`), moved to another role (`userRoleChanged`) or removed (`userRemoved`), and a role created (`roleCreated`), given other permissions (`rolePermissionsChanged`) or deleted (`roleDeleted`). They name users and roles by name and concern no resident. - `userId`, `residentId`, `deviceId`, `locationId` and `zoneId` are ids, not references. Each takes several ids, repeated or comma-separated, and matches a row concerning any of them. Different filters combine with AND. `userId` matches the practitioner who made the change. A value that is not an id answers 422. - `relatedTo` takes typed references (`Patient/<id>`, `Device/<id>`, `Location/<id>`, `Organization/<id>`), repeated or comma-separated, and returns every row concerning any of them, once each. - `actions` keeps the kinds of change you name: `created`, `deleted`, `renamed`, `moved`, `assigned`, `unassigned`, `discharged`, `reactivated`, `thresholdChanged`. Rows recorded before this filter shipped carry no kind, so they never match it. - `resident` on a row is the resident it concerns, `{patientId, residentId}`, or null when it concerns none. `residentId` inside it is their Resident ID, or null when they have none: show a placeholder, never a name. The flat `residentId` carries the same Resident ID, or is empty. Neither is ever a name or an internal id. - Threshold and Signals settings changes made through the Signals API are listed as Threshold changes, with the reason given. - Changes a device makes itself, such as a baseline re-push after a new 7-day mean, are never listed, and never counted in `total`. - Unknown query parameters are ignored. - `page` is zero-based and `count` defaults to 50, maximum 100. `total` counts only rows the list can return, and never exceeds 10,000. Pages from offset 10,000 on come back empty, so narrow the filters or the date range to reach older rows. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/slim/change-history?types=Threshold&types=Resident&page=0&count=50' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```

Move device to another project PUT

Moves a device into another project in your project tree, and optionally places it in a location there. **Auth:** bearer token. The caller must be a practitioner, an admin or a System Owner, and needs `Device:update`. **Scope:** the device must be in the caller's project or one of its sub-projects. The target `projectId` must be your project, its parent or one of its sub-projects. ## Behaviour - The device's resident, location and zone are removed before the move, because those references belong to the old project. - If a resident was assigned, their active out-of-bed episode is closed and their open device use record is ended, in the same write. - When you send `locationId`, the device is placed in that location. The location must be in the target project. - The move is written in one transaction. If it fails, nothing is written. - Moving a device to the project it is already in writes nothing and still succeeds. - The response is `{ success, deviceId, projectId, locationId }`. `locationId` is `null` when you sent none. ## Example ```bash curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/device/assign/project' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{"deviceId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "projectId": "87ea5dfc-8b8e-384d-8489-79496e706390"}' ```