All APIs will be designed with the spirit of the DI API Guidelines in mind.


For most API endpoints, request/response body encryption will be applied. The documentation below describes the unencrypted format.

See Payload Encryption for more details.

GET /v1/status/{product}

Retrieves the status of the given product. This endpoint is not encrypted.

Deprecated. Use GET /v1/product/{product}/status instead.

Path Parameters

NameTypeRequiredSinceDescription
product
Stringyes2.0The product's key

Response Body

NameTypeRequiredSinceDescription
product
Stringyes2.0The sanitized version of the product key
enabled
Booleanyes2.0True if the chatbot is enabled for this product, false otherwise
healthy
Booleanyes2.0True if the chatbot is healthy for this product, false otherwise Currently always true until actual health checks implemented.

GET /v1/product/{product}/config

Returns the client configuration for a given product.

Path Parameters

NameTypeRequiredSinceDescription
product
Stringyes2.0The product's key

Response Body

NameTypeRequiredSinceDescription
enabled
Booleanyes2.0True if the product is enabled, false otherwise.
docked
Booleanyes2.0True if the client is running in docked mode, false otherwise.
opened
Booleanyes2.0True if the client is to be open by default, false otherwise.
customLauncherSelector
Stringno2.0The CSS selector to identify the element that opens the client.
hideDefaultLauncher
Booleanyes2.0True if the client is to hide the default launcher, false to keep it visible.
horizontalPosition
Enumerationyes2.0left to position the client on the left side, right to position it on the right.
verticalPosition
Enumerationyes2.0top to position the client on the top of the page, bottom to position it on the bottom.
playNotificationAudio
Booleanyes2.0True to play notification audio, false otherwise.
useNotificationAPI
Booleanyes2.0True to make use of the browser's Notifications API, false otherwise.
pollingInterval
Integeryes2.0The number of milliseconds between calls to GET /v1/listen.
product
Stringyes2.0The product key. This is a copy of the product path parameter.
themeName
Stringno2.0If not null, specifies a theme other than the product's default theme.
locales
String[]yes2.0The locales supported by the product.
modules
Map<String,Module>yes2.0The modules enabled for this client.
modules[chatbot]
ChatbotModuleyes2.0Configuration of Chatbot integration.
modules[zendeskChat]
ZendeskChatModuleno2.0Configuration of Zendesk Chat integration.
modules[popupChat]
PopupChatModuleno2.3Configuration of the Popup Chat integration.
plugins
Map<String,Plugin>no2.0The plugins enabled for this client.
plugins[cto]
CTOPluginno2.0CTO/Omniture tracking plugin configuration.
plugins[oneid]
OneIDPluginno2.0

GET /v1/product/{product}/loader

Redirects to the configured loader script for the specified product. This endpoint may be used as the src attribute of a <script></script> element. This endpoint is not encrypted.

Path Parameters

NameTypeRequiredSinceDescription
product
Stringyes2.0The product's key

Query Parameters

NameTypeRequiredSinceDescription
v
Stringno

2.0

An alternate version of the client to load. This is for testing purposes.

Response

The server will respond with HTTP 307 - Temporary Redirect. The redirect URL will be to the JavaScript file used to load the chatbot client.

GET /v1/product/{product}/status

Provides the current status of the given product

Path Parameters

NameTypeRequiredSinceDescription
product
Stringyes2.0The product's key

Response Body

NameTypeRequiredSinceDescription
product
Stringyes2.0The product's key
enabled
Booleanyes2.0True if the product is enabled, false otherwise
healthy
Booleanyes2.0True if the product systems are healthy, false otherwise

GET /v1/client/configuration

Retrieves client configuration details. This endpoint is not encrypted.

Request 

No path or query parameters are expected.

Response

The response body will contain a JSON object with the following properties

FieldTypeRequiredSinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.
maximumMessageLength
Integeryes2.0A positive integer indicating the maximum number of characters in a guest-supplied message.
publicKey
Stringyes2.0The server's public key. Used to securely exchange data with the server (eg: randomly generated symmetric encryption key to encrypt traffic).
Deprecated. Use publicKeyEncryption.publicKey instead.
pollFrequency
Integeryes2.0The frequency the client can poll /v1/listen, in milliseconds.
publicKeyEncryption.algorithm
Stringyes2.0The encryption algorithm to employ
publicKeyEncryption.publicKey
Stringyes2.0The server's public key. Used to securely exchange data with the server (eg: randomly generated symmetric encryption key to encrypt traffic).
publicKeyEncryption.version
Stringyes2.0The version identifier of the encryption configuration in use.

POST /v1/start

Initializes a session with the chatbot.

Request Body

FieldTypeRequired?SinceDescription
encryptionKey
StringYes2.0A randomly generated encryption key (AES-256) that is encrypted with the public key from GET /v1/client/configuration and then Base64 encoded.
visitorId
StringNo2.0A unique ID for tracking the visitor over multiple chat sessions. Usually generated by CTO on the client side.
siteCode
StringYes2.0The site that is invoking the chatbot.
pageName
StringYes2.0The name of the page that is invoking the chatbot.

Response Body

FieldTypeRequired?SinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.
chatId
Stringyes2.0The unique identifier of the chat.

POST /v1/hello

Initializes a session with the chatbot, triggering a welcome message from the chatbot.

This is the same as calling /v1/start and then /v1/trigger with the WELCOME trigger value.

Request Body

FieldTypeRequired?SinceDescription
encryptionKey
StringYes2.0A randomly generated encryption key (AES-256) that is encrypted with the public key from GET /v1/client/configuration and then Base64 encoded.
visitorId
StringNo2.0A unique ID for tracking the visitor over multiple chat sessions. Usually generated by CTO on the client side.
siteCode
StringYes2.0The site that is invoking the chatbot.
pageName
StringYes2.0The name of the page that is invoking the chatbot.

Response Body

FieldTypeRequired?SinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.
chatId
Stringyes2.0The unique identifier of the chat.

PUT /v1/trigger

Triggers an action on the chatbot without sending a message. The trigger may or may not result in a new message being appended to the queue.

Request Body

FieldTypeRequired?SinceDescription
trigger
Enum(Trigger)yes2.0The specific trigger to invoke. The constant is case-sensitive.
parameters
Mapno2.0A free-form key/value mapping of parameters to send as part of the trigger.

Response Body

The expected response is an HTTP 202 (Accepted)

FieldTypeRequiredSinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.

PUT /v1/trigger/multiple

Triggers multiple actions on the chatbot without sending a message. The triggers may or may not result in new messages being appended to the queue. Available since 2.7.0.

Request Body

FieldTypeRequired?SinceDescription
triggers
Object[]yes2.7.0The specific triggers to invoke. The constant is case-sensitive.
triggers[i].trigger
Enum(Trigger)yes2.7.0The name of the trigger to invoke. The constant is case-sensitive.
triggers[i].parameters
Mapno2.7.0A free-form key/value mapping of parameters to send as part of the trigger.

Response Body

The expected response is an HTTP 202 (Accepted)

FieldTypeRequiredSinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.

PUT /v1/talk

Sends guest input to the chatbot. This endpoint is expected to return immediately with an HTTP 202 (Accepted) response as the chatbot system will process the input asynchronously. The client is expected to poll the GET /chatbot/v1/listen endpoint for the chatbot response.

Request Body

FieldTypeRequired?SinceDescription
text
Stringyes2.0The text the guest is submitting to the chatbot

Response Body

The expected response is an HTTP 202 (Accepted) as the input submitted by the 

FieldTypeRequired?SinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.

GET /v1/listen

Gets responses from the chatbot.

Request

No path or query parameters are expected.

Response Body

FieldTypeRequired?SinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.
messages
Array(Message)no2.0Text that can be used as clickable/tapable quick-replies

PUT /v1/feedback/message/{id}

Provides feedback on Chatbot generated messages.

Path Parameters

ParameterTypeRequired?SinceDescription
id
Stringyes2.0The ID of the message to provide feedback on. Corresponds to the Message.id field returned by GET /v1/listen endpoint.

Request Body

FieldTypeRequired?SinceDescription
helpful
booleanno2.0If true, flags the message as helpful. If false, flags the message as unhelpful, and if null, removes the helpful flag.

Response Body

FieldTypeRequired?SinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.

POST /v1/goodbye

Terminates the current session with the chatbot.

Request

No body, path, or query parameters are expected.

Response Body

FieldTypeRequired?SinceDescription
error
Object(Error)no2.0If set, indicates an error occurred. Implies a HTTP 4xx/5xx status.

GET /v1/ping

A minimal endpoint to determine if the servlet is running and to get baseline latency. This endpoint returns an HTTP/204 (No Content) if the servlet is running. The response is undefined if there is an error, but it is presumable that a HTTP 4xx/5xx status will be returned, possibly containing a standard Error object. This endpoint is not encrypted.

Request

No path or query parameters are expected.

Response Body

No response body is returned.

POST /v1/logging/{level}

Logs a message at the given log level. The endpoint returns an HTTP/204 (No Content) if the log is accepted and written. The response is undefined if there is an error, but it is presumable that a HTTP 4xx/5xx status will be returned, possibly containing a standard Error object. This endpoint is not encrypted.

Path Parameters

ParameterTypeRequired?SinceDescription
level
Stringyes2.3The level to log at. Must be one of ERROR, WARN, INFO, DEBUG, TRACE.

Request Body

FieldTypeRequired?SinceDescription
visitorId
Stringyes2.3The cross-session visitor ID
sessionId
Stringno2.3The chat session id
timestamp
Stringyes2.3The ISO_8601 date/time timestamp of the log entry, formatted as YYYY-mm-ddTHH:MM:SS.SSSZ (eg: 2022-03-3T17:17:39.123Z)
message
Stringno2.3The optional message to log
agent
Stringyes2.3The browser's user agent string
locale
Stringyes2.3The locale the client is operating in, as a ISO 639 language code with an optional ISO 3166-1 alpha-2 country code (eg: en, en-CA, es-MX)
version
Stringyes2.3The client version
event
Stringno2.3The event to log
latency
numberno2.3The number of milliseconds of latency of the event logged

Response Body

No response body is returned.