I have set up my messenger, messenger deployment, and my message flow. I am able to connect to the websocket, but I am unable to communicate because I get the 400 error every time I sen a message.
@Jorge_Diaz are you trying to use web chat or web messaging? Your original post links to web messaging docs, but your last two comments link to the web chat v2 SDK. Web chat and web messaging are different offerings with no overlap in APIs/tooling. There isn't a JavaScript SDK for web messaging.
Can you share some of your code showing how you're preparing and sending the message across the websocket?
As a general tip for testing websockets, you can connect to a testing service to see what exactly your client is sending. This can be helpful to see what the server is receiving to troubleshoot formatting errors. Of course, be careful not to send any sensitive information, like passwords or PII, to 3rd party services. One such service is Online Websockets Tester - Debug Client Tool.
You must use consistent values across messages.
When you open a websocket connection with a deploymentId, you must use the same deploymentId for the connection lifetime.
I could see that the deploymentId used for opening the connection is not the same one when sending the configureSession.
As Tim mentionned, you may want to use some external tool, online or not.
wscat allows you to test interactively and easily.
npm install -g wscat