Server Events

chat_session_status

This event updates the current state of the chat session. If the state is failed, the client application will assume that the chat session no longer exists.

Format

{
    "event": "chat_session_status",
    "state": "queued|connecting|connected|failed|completed",
    "ewt": "<estimated waiting time for queued status>"
}

chat_session_ended

This event indicates a normal termination of the chat session (e.g., when the chat session is closed by the agent). The client application will assume that the chat session no longer exists.

Format

{
    "event": "chat_session_ended"
}

chat_session_party_joined

This event indicates that a new party (i.e., a new agent) has joined the chat session.

Parameters

ParameterDescription
party_idUnique identifier of the chat party on the server side. A separate identifier is generated for each party (agent) that handles this chat session.

Format

{
    "event": "chat_session_party_joined",
    "party_id": "<party id>",
    "first_name": "<party first name>",
    "last_name": "<party last name>",
    "display_name": "<party display name>",
    "type": "<scenario|external|internal>",
    "timestamp": "<UTC timestamp in milliseconds>"
}

chat_session_party_left

This event indicates that one of the existing parties (e.g., an agent) has left the chat session.

Parameters

ParameterDescription
party_idUnique identifier of the chat session on the server side. A separate identifier is generated for each party (e.g., an agent) that handles this chat session.

Format

{
    "event": "chat_session_party_left",
    "party_id": "<party id>",
    "timestamp": "<UTC timestamp in milliseconds>"
}

chat_session_message

This event contains a new chat message.

Parameters

ParameterDescription
msg_idUnique identifier of the party that sends this message
party_idUnique identifier of the chat session on the server side. A separate identifier is generated for each party (e.g., an agent) that handles this chat session. Note that party ID always matches the chat ID (i.e., when the event is received as part of chat session history).

Format

{
    "event": "chat_session_message",
    "party_id": "<party id>",
    "msg_id": "<message id>",
    "msg": "<chat message>",
    "timestamp": "<UTC timestamp in milliseconds>"
}

chat_session_message_delivered

The mobile application will receive this event when an agent or another party in the chat receives the message sent by the client application.

Parameters

ParameterDescription
ref_msg_idUnique identifier of the message that has been sent
party_idUnique identifier of the party that the message was delivered to

Format

{
    "event": "chat_session_message_delivered",
    "party_id": "<party id>",
    "ref_msg_id": "<message id>",
    "timestamp": "<UTC timestamp in seconds>"
}

chat_session_message_read

The mobile application will receive this event when an agent or another party in the chat reads the message sent by the client application.

Parameters

ParameterDescription
ref_msg_idUnique identifier of the message that has been read
party_idUnique identifier of the party that read the message

Format

{
    "event": "chat_session_message_read",
    "party_id": "<party id>",
    "ref_msg_id": "<message id>",
    "timestamp": "<UTC timestamp in seconds>"
}

chat_session_typing

This event is sent when the agent starts typing.

Parameters

ParameterDescription
party_idUnique identifier of the chat party on the server side. A separate identifier is generated for each party (e.g., an agent) that handles this chat session.

Format

{
    "event": "chat_session_typing",
    "party_id": "<party id>",
    "timestamp": "<UTC timestamp in seconds>"
}

chat_session_not_typing

This event is sent when the agent stops typing.

Parameters

ParameterDescription
party_idUnique identifier of the chat party on the server side. A separate identifier is generated for each party (e.g., an agent) that handles this chat session.

Format

{
    "event": "chat_session_not_typing",
    "party_id": "<party id>",
    "timestamp": "<UTC timestamp in seconds>"
}

chat_session_form_show

This event is sent to the request user’s input from the client application to be entered via a predefined form. The client application is normally supposed to display the specified form to the user and send back the entered data via the event chat_session_form_data.

Format

{
    "event": "chat_session_form_show",
    "form_request_id": "<request ID that will be used by the client application to associate the response>",
    "form_name": "<predefined form name known to the client application>",
    "form_timeout": "form timeout",
    "timestamp": "<UTC timestamp in seconds>"
}

chat_session_secure_form_show

This event is sent to notify the client application that it should display a secure, predefined form to the user and send back the entered data via the event chat_session_secure_form_data.

Format

{
    "event": "chat_session_secure_form_show",
    "form_request_id": "<request ID that will be used by the client application in chat_session_secure_form_data>",
    "form_id": "<Form ID>",
    "timestamp": "<UTC timestamp in seconds>"
}

chat_session_timeout_warning

This event is sent to request that the specified text be displayed to the user of the client application. Typically, it is used to display an inactivity warning message.

Format

{
    "event": "chat_session_timeout_warning",
    "msg": "<warning text>",
    "timestamp": "<UTC timestamp in milliseconds>"
}

chat_session_inactivity_timeout

This event indicates the termination of the chat session due to the user’s inactivity and provides text to be displayed to the user. The client application will assume that the chat session no longer exists.

Format

{
    "event": "chat_session_inactvity_timeout",
    "msg": "<inactivity timeout text>",
    "timestamp": "<UTC timestamp in milliseconds>"
}

chat_session_signaling

This event is a container message for WebRTC signaling messages from the server to the client. These messages are not stored in the chat session history.

Format

{
    "event": "chat_session_signaling",
    "msg_id": "<message id>",
    "data": "<signaling message>"
}

chat_session_file

This event provides notification that a file is being sent to the client. The client can use the parameter file_id to download the file.

Parameters

ParameterDescription
party_idUnique identifier of the chat session on the server side. A separate identifier is generated for each party (agent) that handles this chat session.
msg_idUnique identifier of the corresponding message
partyIdUnique identifier of the party that sends the message

Format

{
    "event": "chat_session_file",
    "party_id": "<party id>",
    "msg_id": "<message id>",
    "file_id": "<file id>",
    "file_type": "<image|attachment>",
    "timestamp": "<event time in Unix format>"
}

chat_session_location

This event contains a new location message.

Parameters

ParameterDescription
msg_idUnique identifier of the message
urlMap url (optional)
latitudeLatitude of the location
longitudeLongitude of the location

Format

{
    "event": "chat_session_location",
    "msg_id": "<message id>"
    "url": "<map url (optional)>”,
    "latitude": “<latitude>”,
    "longitude": “<longitude>”,
    "timestamp": "<UTC timestamp in seconds>"
}

chat_session_cobrowsing_requested

This event is sent to the client application to request a co-browsing session.

Format

{
    "event": "chat_session_cobrowsing_requested",
    "msg_id": "<message id>"
}

chat_session_case_set

The mobile application will receive this event when the scenario specifies the CRM Case ID for the chat session. Once a case is set, the mobile application may use the Get Case History method and the Close Case method.

Parameters

ParameterDescription
case_idID of the CRM case

Format

{
    "event": "chat_session_case_set",
    "case_id": "<message id>",
    "timestamp": "<UTC timestamp in seconds>"
}