WebSocket connection closed abnormally with code 1006 before any conversation:updated events were received.
I am implementing a real-time listener for Genesys Cloud conversation events in an Android app using the OkHttp WebSocket implementation. The initial HTTP upgrade request to /api/v2/analytics/events returns a 101 Switching Protocols status, indicating the handshake was successful. However, the socket disconnects almost instantly without sending any data frames. I have verified that the Bearer token in the initial headers is valid and has the correct analytics:events:read scope. The subscription payload I am sending immediately after connection looks correct according to the documentation.
Here is the subscription JSON payload:
{
"type": "subscribe",
"topics": [
"conversation:updated",
"conversation:created"
],
"filters": [
{
"field": "conversation.id",
"operator": "eq",
"value": "current-session-id"
}
]
}
I have tried increasing the timeout and checking for network interruptions, but the issue persists across different network conditions. Is there a specific keep-alive requirement or a missing header in the WebSocket connection that prevents the server from pushing events? I am also seeing no error logs in the Genesys Cloud admin UI regarding this connection attempt.