Skip to content
endtwist edited this page Sep 14, 2010 · 2 revisions

Most responses can be grouped into a few specific type objects.

Notification

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:

  • joineduser has joined the room
  • leftuser has left the room

Message

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.

Status

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 of user

Key: is
The actual status/state. One of:

  • typing
    • trueuser is typing
    • falseuser is 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

Update

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

Welcome

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"}

QueuePos

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#}

Clone this wiki locally