-
Notifications
You must be signed in to change notification settings - Fork 1
Response Types
Most responses can be grouped into a few specific type objects.
Notifications are sent when an action takes place in a particular room. Only users in that room will receive the notification.
Format
{type: "notification", room: "room_id", user: "username", details: "..."}
Key: details
Can be one of:
-
joined—userhas joined the room -
left—userhas left the room
Messages are sent when a user sends a message in a particular room. Only users in that room will receive the message.
Format
{type: "message", room: "room_id", user: "username", body: "...", sent: #timestamp#}
Key: body
The content of the message with unparsed Markdown formatting and no HTML.
Key: sent
The time the message was sent as a Unix Timestamp.
Statuses can be both room-specific and broadcast to all. Room-specific statuses are intended for typing state updates only. Broadcast statuses are intended for user availability updates.
Format
{type: "status", room: "room_id", user: "username", of: "...", is: "..."}
Key: of
Purpose of the status update. One of:
-
typing— typing state -
availability— the current availability ofuser
Key: is
The actual status/state. One of:
-
typing-
true—useris typing -
false—useris not typing
-
-
availability-
available— user is online and available for contact/assisting -
away— user is not at their computer or is not available for contact/assisting
-
Updates are messages broadcast to agents when an action regarding an agent or guest (or both) occurs. This includes actions such as agent to guest assignment, and changes in an agent’s availability.
Format
{type: "update", users: ["username", ...], details: "..."}
Key: details
Details about this update. One of:
-
assigned— a guest (users[0]) has been assigned to an agent (users[1]) -
available— an agent has become available to help guests -
unavailable— an agent has reached his/her guest limit and/or is not available to help new guests -
queued— a new guest has joined the waiting queue -
dequeued— a guest has been removed from the queue and assigned to an agent
When a client tries to listen and they do not have an identified or authenticated session yet. If this message is received, the client should be prompted to either sign in to their support account or enter their problem information and a username.
Format
{type: "welcome"}
When a guest’s position in the queue changes, they are notified. They are also notified of the current average wait time.
Format
{type: "queuepos", position: #index#, wait: #seconds#}