Need help creating websocket connection to chat

Hi,

I'm trying to establish a websocket connection to web chat using the eventStreamUri I got from this API - https://api.mypurecloud.com/api/v2/webchat/guest/conversations.
I'm using 'ws' package to connect to that uri but not able to in a simple node application.

Please let me know if there are any references to how to create this websocket connection to chat.

Thanks,
Sridevi

Hi,

Checkout Guest Chat APIs if you haven't already. There is some info there on using web sockets. I'm not sure why you cannot create the web socket connection (you should be able to do this with any standard web socket client using the eventStreamUri). Can you provide more context? What exactly is going wrong when you try to connect?

Thanks,

Mike

Hi,

I've gone through the guest chat doc, thanks. I created a new chat conversation using postman and got the eventStreamUri from the response.
This is the piece of code I'm trying:

And it says this error:

Not sure if I'm doing this right, please let me know if I'm missing something or not following the right way.

Thanks,
Sridevi

Hi,

It may be an issue with the web socket client you are using. I would suggest trying another web socket client and if the issue persists open a ticket with Genesys Cloud Customer Care.

Thanks,

Mike

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.