Skip to main content

Server Messages

Server messages can be sent unsolicited or in response to a client message. If a server message is sent in response to a client message, and the client message had an “id” field, the server message will be sent with an optional “reply-to” field that will contain the message identifier for the client message it is in response to.

Client Message Acknowledge

Type: ack

Fields:

Field NameJSON TypeDescription
idStringOptional: if the client message had an id field, this field will contain the same text.
reply-toStringOptional: if the client message this message is sent in response to had an id field, this field will contain the id.
statusBooleanWhether the message was handled correctly or generated an error.

This message is sent after handling each client message. These are sent in the exact order the client messages have been received and each ACK message pertains to one client message received by the server.

Delivery Notification

Type: delivery

Fields:

Field NameJSON TypeDescription
message-idStringThe identifier of the message this delivery notification pertains to
statusStringThe status of the message delivery

The delivery notification message must be sent by the server when a direct message or a channel message sent by the subscriber changes into one of the following statuses:

Status TextDescription
storedThe message has been received by the server and stored for future delivery.
receivedA direct message has been sent to the recipient’s application.
displayedA direct message has been displayed visibly on the recipient’s screen. This could be in the form of a notification.
readA direct message has been fully displayed by an application’s chat or channel view, allowing the recipient to read the full text.

Channel Invitation

Type: invitation

Fields:

Field NameJSON TypeDescription
channel-idStringChannel identification of the channel the subscriber is invited to
nameStringDescription of the channel to show to subscribers
attributesObjectList of channel properties
administratortrue/falseWhether the subscriber is being invited to be an administrator or not

The channel invitation message is sent from the server when a subscriber with administration permissions in a channel invites a user to that channel. The “administrator” flag is used to notify the application that the subscriber can now perform administrative operations.

Channel Unsubscription

Type: unsubscription

Fields:

Field NameJSON TypeDescription
channel-idStringChannel identification of the channel the subscriber was removed from.
subscriberObjectThe subscriber that was removed from the channel. See the Channel Subscriber Model below for the field details.

This message is sent from the server when a subscribe is removed from a channel.

Channel List

Type: channel-list

Fields:

Field NameJSON TypeDescription
channelsArray<ChannelMembership>List of channel membership report. See the Channel Membership model below for the field details.

The channel list message is sent from the server as a response to the List Channels message and contains a list of all channels the user is currently a subscriber of and whether the user is an administrator of the channel or not.

Channel Directory

Type: directory

Fields:

Field NameJSON TypeDescription
channel-idStringChannel identification of the channel this directory lists
subscribersArray<ChannelSubscriber>List of subscribers in the channel. See the Channel Subscriber Model below for the field details.

The directory message is sent to the application in response to a list channel subscribers message. The message includes a list of all subscribers registered in the channel and an indication of their status (to save the application the need to send an availability check message). The “status” field must contain one of the values listed for the announce message, or the value “offline” specifying that that subscriber has not issued an “Announce Availability” message since their last disconnect or since their last “Unannounce” message.

Channel Member Status Notification

Type: member-status

Fields:

Field NameJSON TypeDescription
channel-idStringChannel identification of the channel this notification comes from
subscriberChannelSubscriberSubscriber object whose status has changed. See the Channel Subscriber Model below for the field details.

The member status message is sent to the user agent application when the status of another subscriber in a channel this subscriber is a member of, has changed.

Message

Type: message

Fields:

Field NameJSON TypeDescription
channel-idStringChannel identification of the channel this message was sent in.
message-idStringA globally unique identifier of the message that was sent.
dateStringISO-8601UTC formatted time when the message was sent.
textStringThe content of the channel message.
attributesObjectsList of message properties.

The “channel message” message is sent by the server when another subscriber has sent a message to a channel this subscriber is subscribed to.

Archive Retrieval

Type: archive

Fields:

Field NameJSON TypeDescription
channel-idStringChannel identification of the channel a an archive retrieval request was received for.
countNumberThe number of archived messages retrieved
earliestStringISO8601 formatted time for the earliest time that was scanned in the archive (may be earlier than the earliest message found)
latestStringISO8601 formatted time for the latest time that was scanned in the archive (may be later than the latest message found)

The “Archive Retrieval” message is sent by the server in response to a valid “Retrieve Messages From Archive” message. It contains a count of how many messages were actually retrieved from the archive, that the application is expected to then receive. This message will be followed by zero or more server messages (as per the “count” field in this message), that will be identified by carrying a “reply-to” header identical to the “reply-to” header in this message.

The time stamps sent in this message can have times later than the last message delivered in the archive retrieval transaction, or later than the last message retrieval transaction - often when the server generated less than the requested number of messages (as reported by the “count” field) - the server scans the archive backwards and may give up on fulfilling the full request, if there is a large gap between messages. If the client wishes to try again, the client may send another Retrieve Messages From Archive request with the “earliest” value (or “latest” as the case may be) from this message set as the “time” field - to ask for another try, starting from where the server last stopped.

Notes

  1. See RFC 6750
  2. See RFC 7159 section 4