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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 4

Elektron connection via Python Websockets... 400 - Bad Request

Using the code:

https://github.com/Refinitiv/websocket-api/blob/master/Applications/Examples/RDP/python/market_price_rdpgw_authentication.py

and Sys ARGS: [

'--hostname','com.amazonaws.vpce.eu-west1.vpce-svc-0bcf9da83ec687ab9',

'--user','<ELEKTRON USERNAME>',

'--clientid','<App Key For RDP generated from Eikon App Key Generator>',

'--password','<ELEKTRON PASSWORD>']


Just get 400 bad request... Not using any of the optional params?

Please advise?


pythonelektronwebsockets
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
Accepted
21.8k 57 14 21

Hi @austin.wright,

Those hostnames are for users on Amazon on VPC or Privatelink. If you are connecting through public internet, then use the Service Discovery example I mentioned previously. That example will automatically connect to the hostname for which your ID is permissioned.

PS: Can you confirm that you have a valid RDP ID? Are you able to login to API Playground (refinitiv.com) and invoke https://api.refinitiv.com/streaming/pricing/v1/ endpoint to see the list of allowed hosts.

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
21.8k 57 14 21

Hi @austin.wright,

I would recommend that you start with the Service Discovery example first - that one will connect to the hosts which you are permitted to get data from.

https://github.com/Refinitiv/websocket-api/blob/master/Applications/Examples/RDP/python/market_price_rdpgw_service_discovery.py


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
21.8k 57 14 21

BTW, I can't even resolve the hostname - "com.amazonaws.vpce.eu-west1.vpce-svc-0bcf9da83ec687ab9". Where did you get this from?

To clarify the other two parameters - the username and password have to be RRT-Optimized and not Elektron. In other words, you need an RDP account enabled for getting streaming market data from Refinitiv Real Time Optimized, to be able to access the websockets in cloud.

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.

OK. How does one open a Websockets connection with Elektron logins with python then?
Upvotes
1 1 1 4

Hi Gurpreet.

Thank you for your response.

I got the hostname from https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/refinitiv-websocket-api/documentation#real-time-optimized-new-hostnames-august-2021

Please advise where I can find the hostnames for connecting to Elektron via websockets.

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
1 1 1 4

Gurpreet,

It says I am not permissioned to execute this method.

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
21.8k 57 14 21

Do you have an inhouse RTDS (TREP); are you trying to websocket-connect to your local ADS. Or is the intent to get data from RRT-O in cloud?

For cloud, you will need RDP credentials, which should also be permissioned to get streaming market data. For this you need to talk to your Refinitiv account manager.

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
24.4k 53 17 14

Hello @austin.wright

For the RDP and Machine-ID credentials set up, you may check the "Getting Started for Machine ID" section of this Getting Started with Refinitiv Data Platform article.

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.