For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
16 3 5 8

RDP Streaming Error Authentication Java

Hello,


Im trying to connecto via websocket to RDP Streaming with the following code:

WS_ADDRESS = "wss://amer-3-t2.streaming-pricing-api.refinitiv.com/WebSocket/";

TRKD_AUTHEN_ADDRESS = "https://api.refinitiv.com/auth/oauth2/v1/token";

WS_PROTOCOL = "tr_json2";

WS_PORT = "443";


When i Send the authentication method i got


{ "access_token":"eyJ0eXA.......", "refresh_token":"3498eba0-a27a-4598-a4e8-e870bac77881", "expires_in":"300" , "scope":"", "token_type":"Bearer" }

So, if the auth is ok the code continues to connect via websocket with the WS_ADDRESS, WS_PROTOCOL and WS_PORT and in the onConnected method I send the authentication


{

"ID": 2,

"Domain": "Login",

"Key": {

"NameType": "AuthnToken",

"Elements": {

"AuthenticationToken": "eyJ0eXA....",

"Position": "192.168.1.20",

"ApplicationId": "58dc1....."

}

}

}

And after that I got

RECEIVED:[{"ID":2,"Type":"Status","Domain":"Login","Key":{"Name":"AQIC5wM2LY4SfcwxLcZkqob04mRDlACLtHarWIIpBxXLpog%3D%40AAJTSQACMjAAAlNLABMxOTk2MzA0NDkxMzM1NzMwODAxAAJTMQACMzQ%3D%23"},"State":{"Stream":"Closed","Data":"Suspect","Code":"UsageError","Text":"Login Rejected. Watchlist size of 0 for 'WS JSON2' connection is outside of range [3001,20000] supported for this ADS fanout tier for this type of connection."}}]

2021-03-25 13:08:11.844 [INFO ] [c.t.w.c.WebSocketConnection:87] - Process Message type Status

2021-03-25 13:08:11.844 [INFO ] [c.t.w.c.WebSocketConnection:113] - State Stream Closed state DataSuspect


Can you helpme what Im doing wrong?Thanks.

treprdp-apiwebsocketsrrto
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.

Upvote
Accepted
24.9k 86 10 22

Hi @isanchez

I discussed this with your account team and later in the day I tried to recreate your scenario.

I am now able to connect using your MachineID to a t1 endpoint e.g.

amer-3-t1.streaming-pricing-api.refinitiv.com

I can also connect using the service discovery examples mentioned previously - which automatically select a valid endpoint for you.

IF I try to connect to the wrong tier e.g. t2, I get the following:

Login Rejected. Watchlist size of 2500 for 'WS JSON2' connection

Which is now showing a non-zero watchlist size.

Note that because you're on a trial you will only be able to access certain delayed RICs e.g.

/EUR=

where / = delayed and EUR= is the RIC e.g. for EURO

Your account team should be able to confirm which set of RICS you are licenced for.

If you try to request an unlicensed RIC you will see something like:

Text":"Access Denied: User req to PE(xxx)

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.

Hello @umer.nalla,

Yes they provides me and example with python to execute service discovery, and we are waiting to the permission to the rics that we want to consume, I really aprecciate the support.


Thanks

Upvote
31.6k 37 11 19

Hello @isanchez,

You are connecting to a specific RTTO endpoint via wss://amer-3-t2.streaming-pricing-api.refinitiv.com/WebSocket/ address.

Most likely you are not connecting to the appropriate endpoint, based on what tier you are assigned as RTTO customer.

The tiers are 1, 2 and 3, if you do not have this information, you can find your assigned tier from your Refinitiv account manager.

Currently you are connecting to tier2 via t2.

I would like to suggest, instead of connecting to a specific endpoint, to try example market_price_service_ discovery, that can be downloaded as Websocket API Sample Applications. This example should discover the appropriate endpoint to connect to on your behalf.

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.

Hello @zoya.farberov,

I ask this to our account manager for what tier the account belogs to, but He wants more information how to identify in a better way this. Can you help me please with more information


Thanks

Upvotes
31.6k 37 11 19

Hello @isanchez,

I would recommend using discovery mechanism in market_price_service_discover.py instead of pointing directly to the specific endpoint, as it also means that if the specific endpoint is temporarily unavailable, your connection is assigned to an available endpoint and succeeds.

More information on the currently available endpoints can be found in Refinitiv Real-Time - Optimized Install and Config Guide, section Current Endpoints.

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.

Hello @isanchez

The Service Discovery example for Java is MarketPriceRdpGwServiceDiscovery.java which available on https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/RDP/java website or the WebSocket example download page.


Hi @zoya.farberov

I execute the market_price_service discovery found in this link

https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/RDP/python

And i Got

Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ...

Refinitiv Data Platform authentication HTTP code: 401 Unauthorized

Thanks

Upvotes
52.5k 134 44 63

@isanchez

From my checking. amer-3-t2.streaming-pricing-api.refinitiv.com supports TCP connection which is for Refinitiv Real-Time SDK.

awstcpamer-1-t2.streaming-pricing-api.refinitiv.com14002rwfus-east-1aawstcpamer-3-t2.streaming-pricing-api.refinitiv.com14002rwfus-east-1a,us-east-1bawstcpamer-2-t2.streaming-pricing-api.refinitiv.com14002rwfus-east-1b


To use the WebSocket connection, you need to connect to the following endpoints.

awswebsocketamer-1-t3.streaming-pricing-api.refinitiv.com443tr_json2us-east-1aawswebsocketamer-3-t3.streaming-pricing-api.refinitiv.com443tr_json2us-east-1a,us-east-1bawswebsocketamer-2-t3.streaming-pricing-api.refinitiv.com443tr_json2us-east-1b
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.

Hello @jirapongse.phuriphanvichai,

I tried with the three endpoints and for all I got Failed to resolve hostname aawswebsocketamer-3-t3.streaming-pricing-api.refinitiv.com:443: aawswebsocketamer-3-t3.streaming-pricing-api.refinitiv.com

I need to apply some configuration before?


Thanks

Upvote
24.9k 86 10 22

Hi @isanchez

Were you able to connect using the Service Discovery examples mentioned above?

The tier 2 (t2) endpoint you tried to connect in your original post supports a watchlist size of 3k-20k - which (according to the error) your machine ID is not permissioned for.

So, you should try a tier1 or tier3 endpoint e.g.

amer-3-t1.streaming-pricing-api.refinitiv.com (watchlist size of 1-3k)

amer-3-t3.streaming-pricing-api.refinitiv.com (watchlist size of 20k-50k)

However, as mentioned by my colleagues it would be better to use the service discovery mechanism - which will discover the appropriate endpoint and also provide alternative endpoints in case one is unavailable.


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.

Upvotes
16 3 5 8

Hi @umer.nalla, with the first one I got

RECEIVED:[{"ID":1,"Type":"Status","Domain":"Login","Key":{"Name":"AQIC.."},"State":{"Stream":"Closed","Data":"Suspect","Code":"UsageError","Text":"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."}}]

And with the second one


RECEIVED:[{"ID":1,"Type":"Status","Domain":"Login","Key":{"Name":"AQIC5wM2LY4SfczYS0WaP5d3p3zCUhB0UgwCyPR5kY%2BrnIY%3D%40AAJTSQACMjAAAlNLABMtNTA5ODgzMjQ2MDE5NDU4NzI5AAJTMQACMzQ%3D%23"},"State":{"Stream":"Closed","Data":"Suspect","Code":"UsageError","Text":"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."}}]


In both case the auth method to retrieve the token was OK

{ "access_token":"eyJ0eXAiOiJhd.", "expires_in":"300" , "scope":"", "token_type":"Bearer" }

I execute the market_price_service discovery found in this link

https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/RDP/python

And i Got

Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token

Refinitiv Data Platform authentication HTTP code: 401 Unauthorized

Thanks

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.

Hello @isanchez,

Please verify that you are pointing to the endpoints you think you point.

When pointing to the endpoints t1 and t3, the error message, if it is not the assigned tier for user, should differ in "range". The message that you show is returned on connecting to t3. The message on connecting to t1 should be "

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

},

----

Please confirm, on running discovery example, you should be connecting to the same authentication endpoint

https://api.refinitiv.com:443/auth/oauth2/v1/token

as with the other example, however, the authentication request results in unauthorized, or the next request (for the list of the available endpoints) results in unauthorized for you?

Upvote
24.9k 86 10 22

Hi @isanchez

The messages you show above indicate that on both occasions you tried to connect to a t3 endpoint which you are not licenced for.

If you had connected to a t1 endpoint and were not licenced, I would have expected to see the following:

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

Please try again ensuring you are trying to connect to amer-3-t1.streaming-pricing-api.refinitiv.com

Also, please ask your Account Manager to contact me directly - I will also try to identify and reach out to them.


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.

Hi @isanchez

Can you confirm you have a machineID and long password?

A MachineID looks something like GE-A-1234567-8-1234

If you are able to add a reply here with the following option selected:

and provide your MachineID.

If you are unable to select the above option, please do NOT include your machineID in the reply.


1617006209806.png (4.2 KiB)

Hello @umer.nalla

Of Course I tried the connection to the following endpoint

Sending authentication request...

Status code 200

{ "access_token":"", "expires_in":"300" , "scope":"", "token_type":"Bearer" }

Authentication Succeeded. Received AuthToken: eyJ0eXAiOiJ.

Connecting to wss://amer-3-t1.streaming-pricing-api.refinitiv.com/WebSocket/

WebSocket successfully connected!

SENT on {

"ID": 1,

"Domain": "Login",

"Key": {

"NameType": "AuthnToken",

"Elements": {

"AuthenticationToken": "",

"Position": "172.22.144.1",

"ApplicationId": "58dc1263574f46348361f1f2d9922a11c09270f3"

}

}

}

Stream":"Closed","Data":"Suspect","Code":"UsageError","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."}}

Process Message type Status

State Stream Closed state DataSuspect

Yes I Have MachineID and I Set a strong Password and I cannot see the option to share with you this credentials.

Thanks,

Upvote
24.9k 86 10 22

Hi @isanchez

Thanks for confirming - I was puzzled by your previous reply which said that for both t1 and t3 endpoints you received "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."}}]

which did not make sense.

Your account manager has made contact and I have asked him for your MachineID so I can check what you may be licenced for.

I am not a licensing person, I am API specialist- but my suspicion at this point that your MachinedID licence has been incorrectly configured.

I will discuss this with your Account Manager and report back.


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.