Chat Widget

Get Chat Widget Script

get
/scripts/chat-widget.js

Returns the JavaScript code needed to embed the chat widget on a website

Authorizations
apiKeystringRequired

Your DM Champ API key. Obtain from Settings → API Keys.

Responses
chevron-right
200

JavaScript code for chat widget

application/javascript
stringOptional

JavaScript code

get
/scripts/chat-widget.js
200

JavaScript code for chat widget

Get Chat Widget Configuration

get
/chat-widget-config

Returns the configuration for the chat widget

Authorizations
apiKeystringRequired

Your DM Champ API key. Obtain from Settings → API Keys.

Query parameters
configIdstringRequired

ID of the chat widget configuration

Responses
chevron-right
200

Chat widget configuration

application/json
successbooleanOptionalExample: true
dataobjectOptional

Widget configuration data

get
/chat-widget-config

Get Chat Widget

get
/chat-widget/{configId}

Returns the HTML for the chat widget with the specified configuration

Authorizations
apiKeystringRequired

Your DM Champ API key. Obtain from Settings → API Keys.

Path parameters
configIdstringRequired

ID of the chat widget configuration

Responses
chevron-right
200

HTML content for the chat widget

text/html
stringOptional

HTML content

get
/chat-widget/{configId}

Get Chat Widget with From ID

get
/chat-widget/{configId}/{fromId}

Returns the HTML for the chat widget with the specified configuration and from ID

Authorizations
apiKeystringRequired

Your DM Champ API key. Obtain from Settings → API Keys.

Path parameters
configIdstringRequired

ID of the chat widget configuration

fromIdstringRequired

ID of the source (for tracking purposes)

Responses
chevron-right
200

HTML content for the chat widget

text/html
stringOptional

HTML content

get
/chat-widget/{configId}/{fromId}

Handle Incoming Chat Widget Message

post
/incoming-chat-widget-message

Processes an incoming message from the chat widget and publishes it to a PubSub topic

Authorizations
apiKeystringRequired

Your DM Champ API key. Obtain from Settings → API Keys.

Query parameters
userIdstringRequired

ID of the user/owner to whom the chat widget belongs

Body
messageTypestringRequired

Type of message (e.g., text, reaction)

Default: text
Responses
chevron-right
200

Message processed successfully

application/json
successbooleanOptionalExample: true
messageIdstringOptional

PubSub message ID

Example: 1234567890
post
/incoming-chat-widget-message

Get Chat Widget Messages

get
/chat-widget-messages

Retrieves messages for a specific chat widget conversation

Authorizations
apiKeystringRequired

Your DM Champ API key. Obtain from Settings → API Keys.

Query parameters
fromIdstringRequired

ID of the user/owner of the contact

toIdstringRequired

ID of the chat widget that the contact is using

afterstring · int64Optional

Optional timestamp (in milliseconds) to fetch only messages after this time

Responses
chevron-right
200

List of messages with bot typing status

application/json
isBotTypingbooleanOptional

Whether the bot is currently typing a response

get
/chat-widget-messages

Mark Chat Widget Messages as Read

post
/update-message-read-status

Updates the read status of all unread messages for a specific chat widget conversation

Authorizations
apiKeystringRequired

Your DM Champ API key. Obtain from Settings → API Keys.

Body
fromIdstringRequired

ID of the user/owner of the contact

toIdstringRequired

ID of the chat widget that the contact is using

Responses
chevron-right
200

Messages marked as read successfully

application/json
successbooleanOptionalExample: true
post
/update-message-read-status

Last updated

Was this helpful?