question

Upvotes
Accepted
1 1 1 4

Chat bot is having issue connecting to web circuit

Hi Team, need help in knowing as to why chat bot is not able to connect to websocket using the trace below

======================

2023-02-07 16:19:42,358 - INFO - stdout - write - Connecting to WebSocket wss://api.collab.refinitiv.com/services/nt/api/messenger/v1/stream ...

2023-02-07 16:19:42,389 - DEBUG - websocket - debug - Connecting proxy...

2023-02-07 16:19:42,389 - DEBUG - websocket - dump - --- request header ---

2023-02-07 16:19:42,389 - DEBUG - websocket - dump - CONNECT http://api.collab.refinitiv.com:443 HTTP/1.1

Host: http://api.collab.refinitiv.com:443

Proxy-Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

2023-02-07 16:19:42,389 - DEBUG - websocket - dump - -----------------------

2023-02-07 16:19:42,389 - DEBUG - websocket - trace - --- response header ---

2023-02-07 16:19:42,452 - DEBUG - websocket - trace - HTTP/1.0 200 Connection established

2023-02-07 16:19:42,452 - DEBUG - websocket - trace - -----------------------

2023-02-07 16:19:42,577 - DEBUG - websocket - dump - --- request header ---

2023-02-07 16:19:42,577 - DEBUG - websocket - dump - GET /services/nt/api/messenger/v1/stream HTTP/1.1

Upgrade: websocket

Host: api.collab.refinitiv.com

Origin: https://api.collab.refinitiv.com

Sec-WebSocket-Key: F9NtUb/arQhPOE7/hYhpoA==

Sec-WebSocket-Version: 13

Connection: Upgrade

Sec-WebSocket-Protocol: messenger-json

2023-02-07 16:19:42,577 - DEBUG - websocket - dump - -----------------------

2023-02-07 16:19:42,577 - DEBUG - websocket - trace - --- response header ---

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - HTTP/1.1 101 Switching Protocols

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Upgrade: websocket

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Connection: Upgrade

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Sec-WebSocket-Accept: 1DFNbPgIcIdeycRnV72ly4iU008=

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Sec-WebSocket-Protocol: messenger-json

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - X-Nitro-Hostname: dtcp-clantsv12

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - X-Nitro-Version: 2.23.6

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - -----------------------



#technologymessenger-bot-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
23.8k 52 17 14

Hello @arbie.tapel

Thank you for contacting us. Could you please let me know if the chatbot cannot connect to the Chatbot WebSocket server every time or only sometimes?

  • Please share the snippet code and full log messages.
  • Does the client has any Firewall or proxy policy on their site?

I did a quick test with the Python example and it can connect to the Chatbot WebSocket successfully. The trace messages are as follows:

Connecting to WebSocket wss://api.collab.refinitiv.com/services/nt/api/messenger/v1/stream ...
--- request header ---
2023-02-08 11:45:14: DEBUG:websocket :--- request header ---
GET /services/nt/api/messenger/v1/stream HTTP/1.1
Upgrade: websocket
Host: api.collab.refinitiv.com
Origin: https://api.collab.refinitiv.com
Sec-WebSocket-Key: RvXt22cFF6FtAKHozlKd8g==
Sec-WebSocket-Version: 13
Connection: Upgrade
Sec-WebSocket-Protocol: messenger-json


2023-02-08 11:45:14: DEBUG:websocket :GET /services/nt/api/messenger/v1/stream HTTP/1.1
Upgrade: websocket
Host: api.collab.refinitiv.com
Origin: https://api.collab.refinitiv.com
Sec-WebSocket-Key: RvXt22cFF6FtAKHozlKd8g==
Sec-WebSocket-Version: 13
Connection: Upgrade
Sec-WebSocket-Protocol: messenger-json
-----------------------
2023-02-08 11:45:14: DEBUG:websocket :-----------------------
--- response header ---
2023-02-08 11:45:14: DEBUG:websocket :--- response header ---
HTTP/1.1 101 Switching Protocols
2023-02-08 11:45:14: DEBUG:websocket :HTTP/1.1 101 Switching Protocols
Upgrade: websocket
2023-02-08 11:45:14: DEBUG:websocket :Upgrade: websocket
Connection: Upgrade
2023-02-08 11:45:14: DEBUG:websocket :Connection: Upgrade
Sec-WebSocket-Accept: IFhQ9c43ld0S0Pdo00Fy1BvbE5U=
2023-02-08 11:45:14: DEBUG:websocket :Sec-WebSocket-Accept: IFhQ9c43ld0S0Pdo00Fy1BvbE5U=
Sec-WebSocket-Protocol: messenger-json
2023-02-08 11:45:14: DEBUG:websocket :Sec-WebSocket-Protocol: messenger-json
X-Nitro-Hostname: dtcp-clantsv10
2023-02-08 11:45:14: DEBUG:websocket :X-Nitro-Hostname: dtcp-clantsv10
X-Nitro-Version: 2.23.6
2023-02-08 11:45:14: DEBUG:websocket :X-Nitro-Version: 2.23.6
-----------------------
2023-02-08 11:45:14: DEBUG:websocket :-----------------------
2023-02-08 11:45:14: INFO:root :Receive: onopen event. WebSocket Connection is established

Example code:

web_socket_app = websocket.WebSocketApp(
        ws_url,
        on_message=on_message,
        on_error=on_error,
        on_close=on_close,
        on_open=on_open,
        subprotocols=['messenger-json'])
...
def on_open(_):  # Called when handshake is complete and websocket is open, send login
    # send RDP Login authen


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.