Error with websocket API connection to https://api.refinitiv.com/streaming/pricing/v1/

adamU93
adamU93 LSEG
edited September 5 in WebSocket API

I am running the following example code: https://github.com/Refinitiv/websocket-api/blob/master/Applications/Examples/RTO/python/market_price_rto_service_discovery.py as follows: ``` python3 market_price_rto_service_discovery.py --user "" --password "" --clientid ""

The output is: ``` Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ... LSEG Delivery Platform Authentication succeeded. RECEIVED: { "access_token":"", "expires_in":"600", "refresh_token":"", "scope":"trapi.streaming.pricing.read", "token_type":"Bearer" } Sending LSEG Delivery Platform service discovery request to https://api.refinitiv.com/streaming/pricing/v1/ LSEG Delivery Platform Service discovery succeeded. RECEIVED: { "services":[ { "dataFormat":[ "tr_json2" ], "endpoint":"ap-northeast-1-aws-1-sm.optimized-pricing-api.refinitiv.net", "location":[ "ap-northeast-1a" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"ap-northeast-1-aws-3-sm.optimized-pricing-api.refinitiv.net", "location":[ "ap-northeast-1a", "ap-northeast-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"ap-northeast-1-aws-2-sm.optimized-pricing-api.refinitiv.net", "location":[ "ap-northeast-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"ap-southeast-1-aws-1-sm.optimized-pricing-api.refinitiv.net", "location":[ "ap-southeast-1a" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"ap-southeast-1-aws-3-sm.optimized-pricing-api.refinitiv.net", "location":[ "ap-southeast-1a", "ap-southeast-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"ap-southeast-1-aws-2-sm.optimized-pricing-api.refinitiv.net", "location":[ "ap-southeast-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"eu-central-1-aws-1-sm.optimized-pricing-api.refinitiv.net", "location":[ "eu-central-1a" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"eu-central-1-aws-3-sm.optimized-pricing-api.refinitiv.net", "location":[ "eu-central-1a", "eu-central-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"eu-central-1-aws-2-sm.optimized-pricing-api.refinitiv.net", "location":[ "eu-central-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"eu-west-1-aws-1-sm.optimized-pricing-api.refinitiv.net", "location":[ "eu-west-1a" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"eu-west-1-aws-3-sm.optimized-pricing-api.refinitiv.net", "location":[ "eu-west-1a", "eu-west-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"eu-west-1-aws-2-sm.optimized-pricing-api.refinitiv.net", "location":[ "eu-west-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"us-east-1-aws-1-sm.optimized-pricing-api.refinitiv.net", "location":[ "us-east-1a" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net", "location":[ "us-east-1a", "us-east-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"us-east-1-aws-2-sm.optimized-pricing-api.refinitiv.net", "location":[ "us-east-1b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"us-east-2-aws-1-sm.optimized-pricing-api.refinitiv.net", "location":[ "us-east-2a" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"us-east-2-aws-3-sm.optimized-pricing-api.refinitiv.net", "location":[ "us-east-2a", "us-east-2b" ], "port":443, "provider":"aws", "transport":"websocket" }, { "dataFormat":[ "tr_json2" ], "endpoint":"us-east-2-aws-2-sm.optimized-pricing-api.refinitiv.net", "location":[ "us-east-2b" ], "port":443, "provider":"aws", "transport":"websocket" } ] } Connecting to WebSocket wss://us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net:443/WebSocket for session1... WebSocket successfully connected for session1! SENT on session1: { "Domain":"Login", "ID":1, "Key":{ "Elements":{ "ApplicationId":"256", "AuthenticationToken":"", "Position":"127.0.1.1/WSL-CPC-D-JXE2L" }, "NameType":"AuthnToken" } } RECEIVED on session1: [ { "Domain":"Login", "ID":1, "Key":{ "Name":"AQIC5wM2LY4SfcwTbT4uNW3hysQJ3fJcaRaq3lEuC75b1SI%3D%40AAJTSQACMTAAAlNLABQtMTc1MjA0NTA0NTU4NzkyMzA4MwACUzEAAjI1%23" }, "State":{ "Code":"UsageError", "Data":"Suspect", "Stream":"Closed", "Text":"Login Rejected. Watchlist size of 0 for 'WS JSON2' connection is outside of range [1,3000] supported for this ADS fanout tier for this type of connection." }, "Type":"Status" } ]

I tried adding the `--ric "GBP=X"` argument and received the same error. Technical support noticed that the service discovery process had determined that a small ("sm") endpoint should be used. I edited the script to hard-code it to use "us-east-1-aws-3-lrg.optimized-pricing-api.refinitiv.net", and login failed with the following message:

"Login Rejected. Watchlist size of 0 for 'WS JSON2' connection is outside of range [20001,50000] supported for this ADS fanout tier for this type of connection."

When I hard-code it to use "us-east-1-aws-3-med.optimized-pricing-api.refinitiv.net", I get a completely different error:

Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ... LSEG Delivery Platform Authentication succeeded. RECEIVED: { "access_token":"", "expires_in":"600", "refresh_token":"", "scope":"trapi.streaming.pricing.read", "token_type":"Bearer" } Connecting to WebSocket wss://us-east-1-aws-3-med.optimized-pricing-api.refinitiv.net/WebSocket for session1... Session: session1; Error: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007) WebSocket Closed for session1 Reconnect to the endpoint for session1 after 3 seconds... Connecting to WebSocket wss://us-east-1-aws-3-med.optimized-pricing-api.refinitiv.net/WebSocket for session1... Session: session1; Error: [Errno 104] Connection reset by peer WebSocket Closed for session1 Reconnect to the endpoint for session1 after 3 seconds... Connecting to WebSocket wss://us-east-1-aws-3-med.optimized-pricing-api.refinitiv.net/WebSocket for session1... Session: session1; Error: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007) WebSocket Closed for session1 Reconnect to the endpoint for session1 after 3 seconds...

We use these credentials successfully to connect using the Java SDK. How can I establish a connection to the websocket API using this account?

Answers

  • Gurpreet
    Gurpreet admin
    edited September 4

    Watchlist size of 0 implies that it is an account permissioning issue (improperly configured). Please raise it up with the account manager.