Testing requires a valid API key. Generate a web integration token from your agent’s Web Integrations settings in the Dasha BlackBox dashboard before starting.
Prerequisites
Before you start, ensure you have:- A Dasha BlackBox agent with chat enabled
- A web integration token (from Dashboard → Agent → Web Integrations)
- The
AllowWebChatfeature enabled on your web integration
Connection flow
Connection flow
Text chat follows this message sequence:
Step 1: Establish connection
Connect to the WebSocket endpoint and send theinitialize message:
Example: WebSocket connection for chat
Example: WebSocket connection for chat
connection event when the agent session is ready:
Example: Connection event response
Example: Connection event response
Step 2: Send messages
Use theincomingChatMessage type to send text messages:
Example: Send chat message
Example: Send chat message
IncomingChatMessage schema
Step 3: Receive messages
Handle incoming messages from the server:Example: Handle incoming messages
Example: Handle incoming messages
TextHistoryMessage schema
TextHistoryMessage example
TextHistoryMessage example
Step 4: End conversation
Send aterminate message and wait for the conversation result:
Example: End conversation gracefully
Example: End conversation gracefully
ConversationResultHistoryMessage example
ConversationResultHistoryMessage example
Next steps
Message Reference
Complete schema documentation for all WebSocket messages
Voice Call Implementation
Add WebRTC voice calls to your integration
Tool Execution
Handle agent tool calls via WebSocket
Error Handling
Handle connection errors and edge cases