WebSockets
The WebSockets API provides real-time event streaming for monitoring call activity and system events.
Base URL​
wss://api.audian.com:8443/v2/websocket
Overview​
WebSockets enable real-time bidirectional communication with the Audian platform. Receive instant notifications about calls, presence changes, and system events without polling.
Connection​
Establishing Connection​
const socket = new WebSocket('wss://api.audian.com:8443/v2/websocket');
socket.onopen = function() {
// Authenticate after connection
socket.send(JSON.stringify({
action: 'subscribe',
auth_token: '{AUTH_TOKEN}',
account_id: '{ACCOUNT_ID}',
bindings: ['call.*', 'presence.*']
}));
};
socket.onmessage = function(event) {
const data = JSON.parse(event.data);
console.log('Event:', data);
};
Event Types​
| Event | Description |
|---|---|
call.CHANNEL_CREATE | New call started |
call.CHANNEL_ANSWER | Call answered |
call.CHANNEL_DESTROY | Call ended |
presence.update | User presence changed |
Bindings​
Subscribe to specific event patterns:
| Pattern | Description |
|---|---|
call.* | All call events |
call.CHANNEL_CREATE | Specific call event |
presence.* | All presence events |
Documentation In Progress
This documentation is being expanded. Check back soon for complete API reference.