WebSocket endpoint for web calls
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://blackbox.dasha.ai/api/v1/ws/webCall', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://blackbox.dasha.ai/api/v1/ws/webCall \
--header 'Authorization: Bearer <token>'import requests
url = "https://blackbox.dasha.ai/api/v1/ws/webCall"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)WebSocket endpoint for web calls
Establishes a WebSocket connection for real-time web-based calls. This is not a traditional HTTP endpoint - it upgrades to WebSocket protocol.
GET
/
api
/
v1
/
ws
/
webCall
WebSocket endpoint for web calls
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://blackbox.dasha.ai/api/v1/ws/webCall', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://blackbox.dasha.ai/api/v1/ws/webCall \
--header 'Authorization: Bearer <token>'import requests
url = "https://blackbox.dasha.ai/api/v1/ws/webCall"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)Connection Types
Chat (chat):
- Text-based conversations without voice
- No WebRTC required
- Lower bandwidth usage
- Use cases: customer support chat, FAQ bots
webCall):
- Browser-based voice calls using WebRTC
- Real-time audio streaming
- Requires HTTPS and microphone access
- Use cases: voice customer support, interactive demos
onPhone):
- Traditional phone calls via SIP
- External phone number required
- Works with landlines/mobile devices
- Use cases: outbound campaigns, call centers
Message Format
All messages use JSON structure:{
"type": "message_type",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {},
"content": {}
}
Client → Server Messages
- initialize: Start new conversation with call type
- incomingChatMessage: Send text message
- sdpAnswer: Respond to WebRTC SDP offer
- websocketToolResponse: Return tool execution result
- terminate: End conversation
Server → Client Messages
- event: System events (connection, opened, closed)
- text: Text messages from agent or user
- sdpInvite: WebRTC SDP offer for voice calls
- toolCall: Agent requesting tool execution
- conversationResult: Final conversation summary
- error: Error messages
Connection Flow
- Establish connection to WebSocket endpoint
- Send initialize message with call type and configuration
- Receive connection event when agent is ready
- Exchange messages bidirectionally
- Send terminate to end session gracefully
Was this page helpful?