const ws = new WebSocket(‘wss://api.mypurecloud.com/v2/notifications/events’);
ws.onopen = () => {
const payload = {
topic: ‘/v2/conversations’,
filters: { types: [‘CALL’] },
auth: { token: ‘Bearer <MY_ACCESS_TOKEN>’ }
};
ws.send(JSON.stringify(payload));
};
The handshake works fine until the subscription message goes out. Server throws a 1008 POLICY_VIOLATION right after the send. The NOTIFICATION CHANNEL is configured and the SUBSCRIPTION TOPIC matches the docs exactly. We’ve tried swapping the AUTH TOKEN with a fresh one but the server just cuts the connection right after the payload hits the endpoint.
- Genesys Cloud US1 region
- Node.js 18.17 using native WebSocket
- OAuth client credentials grant
- Subscribed to /v2/conversations with CALL filter