Omni-channel alerts

Remove the project's omni-channel alerts rule

  • Sandbox: available
  • On your own host? Choose https://{host} in the playground.
DELETE
/v1/omnichannel-alerts/rules

Removes your project's omni-channel alerts rule. From then on Ovok tells nobody of alert events, even with the setting on.

Scope: the caller's project (from the token).

Example

curl -X DELETE 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'

Who can call it: a project admin. See roles.

Authorization

bearer
headerAuthorizationBearer <JWT>

Response Body

Removed: nobody is told of alert events any more.

Example Request
curl -X DELETE 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules'
Example Response
Empty

Get the project's omni-channel alerts rule GET

Returns your project's omni-channel alerts rule: the JSON Logic Ovok runs on each alert event Signals sends, to choose who it tells and over which channels. **Scope:** the caller's project (from the token). ## Behaviour - `notifications` is `{ logic }`, or `null` when the project has no rule and nobody is told. - Ovok keeps the rule with your project. Signals is not involved. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ``` **Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).

Set the project's omni-channel alerts rule PUT

Sets your project's omni-channel alerts rule. With `OMNICHANNEL_ALERTS_ENABLED` on, Ovok runs it on each alert event Signals sends and tells the people it names by email and push. **Scope:** the caller's project (from the token). ## Behaviour - `logic` is JSON Logic answering up to 10 entries for one event: `{ "notify": { "channels": [...], "to": [...] } }`. An empty list or `null` tells nobody of that event. - The rule reads `event` (`alert.triggered`, `alert.empty`, `alert.note`, `alert.inactive`, `alert.refired`, `alert.resolved` or `alert.acknowledged`), `alert.id`, `alert.code`, `alert.reason`, `alert.message`, `alert.value` and `patient.id`. - `channels`: `push`, `email`. - `to`: `practitioner` (general practitioners and practitioners the patient shares their record with), `caregiver` (active care team members), `relatedPerson` (the patient's related persons) and `sharedWith` (the people the patient shares readings with). - A written-out entry naming a channel or recipient Ovok does not know is refused with `UNKNOWN_NOTIFY_LABELS`. A rule that fails on any event type is refused with `INVALID_NOTIFICATIONS`. ## Example ```bash curl -X PUT 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/rules' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{"logic":{"if":[{"==":[{"var":"event"},"alert.triggered"]},{"notify":{"channels":["push","email"],"to":["practitioner","caregiver"]}},[]]}}' ``` **Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).