I’m trying to build a custom chat UI for a client who hates the default widget styling. I’ve got the OAuth token generation working fine via the server, but the WebSocket handshake keeps failing with a 403 Forbidden. The docs say to use the wss://conversations.genesys.cloud/api/v2/conversations/guests endpoint, but I’m unsure if I need to pass the token in the query string or a header.
Here’s the connection logic:
const ws = new WebSocket(`wss://conversations.genesys.cloud/api/v2/conversations/guests?access_token=${token}`);
ws.onopen = () => console.log('Connected');
ws.onerror = (err) => console.error('WS Error', err);
The error object just says code: 1006. I’ve checked the token validity with a standard REST call and it works. Is the Guest API restricted to specific domains even with a valid token? I’ve been staring at this for two hours.