WebSocket API for managing real-time chatbot connections and messaging.
Development WebSocket API server.
Client establishes a WebSocket connection.
Establish a WebSocket connection.
Available only on servers:
Accepts the following message:
Client disconnects from the WebSocket.
Disconnect from the WebSocket.
Available only on servers:
Accepts the following message:
Clients request information about their WebSocket connection.
Request connection information.
Available only on servers:
Accepts the following message:
{
"action": "connection-info"
}
Clients request information about their WebSocket connection.
Receive connection information.
Available only on servers:
Accepts the following message:
{
"connection_id": "string",
"connected_at": "2019-08-24T14:15:22Z",
"ttl": 1,
"expires_at": "2019-08-24T14:15:22Z"
}
Clients send messages to the chatbot.
Send a message to the chatbot.
Available only on servers:
Accepts the following message:
{
"action": "send-message",
"conversation_id": "cc71b11a-25cd-4c2d-9950-df2cc38e3407",
"message_id": "d7d9d9fd-478f-40e6-b651-49b7f19878a2",
"username": "string",
"feature_id": "string",
"content": "string",
"document_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"document_contexts": [
"string"
],
"role": "user",
"message_datetime": "2019-08-24T14:15:22Z"
}
Clients send messages to the chatbot.
Receive a message from the chatbot.
Available only on servers:
Accepts the following message:
{
"message_id": "d7d9d9fd-478f-40e6-b651-49b7f19878a2",
"message_type": "INTERIM_THOUGHT",
"content": "string",
"role": "assistant",
"message_datetime": "2019-08-24T14:15:22Z"
}
Clients request an upload link for sending files.
Request an upload link.
Available only on servers:
Accepts the following message:
{
"action": "request-upload",
"conversation_id": "cc71b11a-25cd-4c2d-9950-df2cc38e3407",
"document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",
"username": "string",
"filename": "string",
"mime_type": "text/plain",
"size_bytes": 0
}
Clients request an upload link for sending files.
Server responds with an upload link.
Available only on servers:
Accepts the following message:
{
"upload_url": "string",
"expires_in": 0
}