API Command: send_chat_message

The send_chat_message operation sends a chat message to an existing session. All members of the session see the chat message. The chat message can be sent on behalf of an existing member of the session, such as a customer or a representative, or it can be sent as a system message. The chat bot uses this API to send the end user's chat messages to the representative.

The command API is an authenticated API. For instructions on using authenticated APIs using OAuth, see Authenticate to the Remote Support API. The API account must have read-only or full access to the command API.

Required Parameters for send_chat_message

Name Type Required? Description
lsid GUID required This is the unique Logging Session ID (LSID) of the session in which the chat message will be sent.
body string required The content of the chat message.  Text formatting can be specified using BBCode (see below).
impersonate string optional

This is a string identifying the user in the session from which the message appears to be sent.  Valid values are:

  • customer: The message appears to come from the customer who is in the session.
  • rep:<user_id>: The message appears to come from the representative with the given user_id.
  • rep_username:<username>: The message appears to come from the representative with the given username.

If this parameter is not provided, the chat message is rendered as a system chat message.

timestamp integer optional The UNIX timestamp at which the chat message was originally sent.  The timestamp must be in the past according to the B Series Appliance's clock.  If not specified, chat messages are sent with the current time.

Text Formatting

The chat message's body can be formatted using the following BBCode:

BBCode Result
[b]bolded text[/b] bolded text

[color=blue]blue text[/color]


[color=#0000FF]blue text[/color]

blue text


blue text

[i]italicized text[/i] italicized text
[u]underlined text[/u] underlined text
[ul][li]list element 1[/li][li]list element 2[/li][/ul]
  • list element 1
  • list element 2
[url]https://www.beyondtrust.com/[/url] https://www.beyondtrust.com/


Chat messages sent via this Command API include a special attribute in reports indicating which API Account originally sent the message. End users and representatives do not know the chat message came from an API Account unless they are in the session and see that the chat message is sent on their own behalf.

Real-time Chat Translations

Chat messages sent with this Command API operation are not affected by the Real-Time Chat Translations feature. All chat messages sent by this operation will be rendered to both customers and representatives exactly as they were specified in the API call. No real-time translation is performed.

Query Examples: send_chat_message


https://support.example.com/api/command?action=: send_chat_message