Skip to main content

Chat

Secure chat lets a doctor and a patient exchange messages. When the doctor starts a conversation, RxScale invites the patient by email. If your own app should bring the patient into the chat instead, create a single-use token for the conversation and hand it to the patient’s app. The RxScale patient SDK redeems the token and opens the chat.
These endpoints are available only to organisations with the secure chat feature enabled. Without the feature, or without the required permission, the API answers 403; the two cases have different bodies, see Errors. See Permissions.
To learn about new conversations and new messages as they happen, subscribe to the chat_conversation_started and chat_message_created webhooks.

Create a Patient Token

Create a single-use token that lets the patient of a conversation into the chat.
Required permission: chat:patient_token
string
required
The chat conversation UID, as sent in the chat_conversation_started webhook
The request has no body.

Example Request

Response (201 Created)

Treat the token like a password: anyone who has it can open the chat as the patient. It is single-use. Send it only to the patient’s own app, over a secure connection, and never log it.
Every call creates a new token. Earlier tokens stay valid until they are used or expire, so create a token when the patient is about to open the chat rather than in advance.

Errors

A 403 for a missing chat feature has the body:
A 403 for a missing permission has the body below. Branch on code; the description names the missing permission and its wording may change:
A 404 has the body:
A conversation of another organisation is reported exactly like an unknown UID.