Skip to main content

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​

EventDescription
call.CHANNEL_CREATENew call started
call.CHANNEL_ANSWERCall answered
call.CHANNEL_DESTROYCall ended
presence.updateUser presence changed

Bindings​

Subscribe to specific event patterns:

PatternDescription
call.*All call events
call.CHANNEL_CREATESpecific call event
presence.*All presence events
Documentation In Progress

This documentation is being expanded. Check back soon for complete API reference.