Building a custom chat UI in Kotlin instead of using the default widget. Trying to connect to the Guest API WebSocket endpoint at wss://{subdomain}.mypurecloud.com/api/v2/guest/conversations/websocket. The connection attempt immediately returns a 403 Forbidden. I’m passing the authorization header with a valid OAuth token generated via client credentials. The token works fine for REST calls to /api/v2/users/me. Here’s the setup:
kotlin
val request = WebSocketRequest.Builder()
.url(wsUrl)
.addHeader("Authorization", "Bearer $token")
.build()
The docs say the token needs webmessaging:guest scope, which it has. Any idea why the handshake is failing?