Elektron Real Time in Cloud connection errors using Python and websocket.

Hello,
There is a following link, which helps retrieve data in Elektron https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/RDP/python . Inside this folder are 2 python files. I am trying to run both of the codes however got the following error
Sending authentication request with password to https://api.refinitiv.com:15000/auth/oauth2/v1/token ...
EDP-GW authentication exception failure: HTTPSConnectionPool(host='api.refinitiv.com', port=15000): Max retries exceeded with url: /auth/oauth2/v1/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001F4E99B9488>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
Process finished with exit code 1
I have set following variables:
# Global Default Variables
app_id = '256'
auth_url = 'https://api.refinitiv.com:443/auth/oauth2/v1/token';
hostname = '127.0.0.1'
password = 'PASSWORD WHEN REGISTER MACHINE ID'
position = ''
sts_token = ''
refresh_token = ''
user = 'MY EMAIL ADDRESS'
clientid = 'APP KEY VIA https://emea1.apps.cp.thomsonreuters.com/apps/AppkeyGenerator'
port = '443'
client_secret = ''
scope = 'trapi'
ric = '/TRI.N'
service = 'ELEKTRON_DD'
What should I do to retreive the market prices?
Best Answer
-
Hello @g.suhharukov
Please be informed that the username for the Refinitiv Real-Time Optimized (formerly known as Elektron Real-Time in Cloud) should be a "machine id" (GE-XXXXXX..), not your email address. I suggest you contact your Refinitiv representative to help you get the machine id.
0
Answers
-
From
Sending authentication request with password to https://api.refinitiv.com:15000/auth/oauth2/v1/token ...
It looks like you have modified or set authentication host and port to override the default value, and it's the wrong one.
Auth URL should be below link as defined in the global default variable.
https://api.refinitiv.com:443/auth/oauth2/v1/token
What example are you using now? And What command-line argument are you using?
You can follow the instruction from the following quick-start guide to run the example.
https://developers.refinitiv.com/en/api-catalog/elektron/refinitiv-websocket-api/quick-start0 -
moragodkrit.chumsri_1 Now I used
auth_url = 'https://api.refinitiv.com:443/auth/oauth2/v1/token';
port = '443'
And the error is the same:
Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ...
EDP-GW authentication HTTP code: 400 Bad Request
0 -
Does the api.refinitiv.com:443 is blocked on your site?
You can verify by using Postman example (RDP-> Authenticate -> Get Access Token, download here)
0 -
wasin.waeosri Yes, exactly. I just changed user to be a Machine ID and it seems it started connecting, however following error appeared
Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ...
EDP-GW Authentication succeeded. RECEIVED:
{
"access_token":"",
"expires_in":"300",
"refresh_token":"",
"scope":"trapi.auth.cloud-credentials trapi.cfs.claimcheck.read trapi.data.symbology.advanced.read trapi.data.symbology.read trapi.metadata.read trapi.streaming.pricing.read",
"token_type":"Bearer"
}
Connecting to WebSocket wss://127.0.0.1:443/WebSocket ...
[WinError 10061] No connection could be made because the target machine actively refused it
WebSocket Closed
0 -
400 Bad request is not the problem with the host. It seems to be the format of the request application sent.
- Can you please restore the source codes to the original one and do not change any codes.
Then run the following command line and replaced Your RDP Username, Your RDP Password, and Client ID with your RDP login.
python.exe market_price_edpgw_service_discovery.py --user "<Your RDP Username>" --password "<Your RDP Password>" --clientid "Client ID"0 -
moragodkrit.chumsri_1 I restored everything added Username, Password and Client ID. Additionally I added
hostname = '127.0.0.1'
because without it I got an error user, clientid, password, and hostname are required options. And when inserted these 4 things, I got the same error (described above)
[WinError 10061] No connection could be made because the target machine actively refused it
WebSocket Closed
0 -
wasin.waeosri Yes, when I put api.refinitiv.com:443 I am redirected to https://apidocs.refinitiv.com/Apps/ApiDocs and the red banner shows "Authentication failed:Error getting token". However when I run in Python it seems I got auth. token and new error authentication
0 -
I also found that in email sent By Reuters was written "python.exe market_price_edpgw_authentication.py --hostname emea-1.pricing.streaming.edp.thomsonreuters.com --user YourMachine --clientid YourMachine --password YourPassword"
So, I changed hostname to emea-1.pricing.streaming.edp.thomsonreuters.com, but it has the same issues as with previous hostname. Regarding "--user YourMachine --clientid YourMachine" I also tried different combinations such as app key + machine id, in both only machine id... and the same issue described below.
I now updated global variables and have the following errors:
Connecting to WebSocket wss://127.0.0.1:443/WebSocket ...
[WinError 10061] No connection could be made because the target machine actively refused it
WebSocket Closed
And in the second file https://github.com/Refinitiv/websocket-api/blob/master/Applications/Examples/RDP/python/market_price_edpgw_service_discovery.py
Here I see, that it has not smth. As a result ,trying to refresh everything
SENT on session1:
{
"Type":"Pong"
}
RECEIVED on session1:
[
{
"Type":"Ping"
}
]
SENT on session1:
{
"Type":"Pong"
}
0 -
Hello @g.suhharukov,
To re-iterate the info from @wasin.w and @moragodkrit.chumsri_1, hostname = 127.0.0.1 will not work, as it is your local hostname, not ERT endpoint.
The latest version of example market_price_edpgw_authentication.py ,can be found at Websocket API -> Downloads, the mandatory parameters are:
--user, --clientid, --password, and --hostname.
I am testing from Americas region, my command line is:
python market_price_edpgw_authentication.py --hostname amer-1.pricing.streaming.edp.thomsonreuters.com --user MYMACHINEID --password MYLONGPASSWORD --clientid MYAPIKEY
If you are connecting from Europe, replace "amer-1" with "emea-1"
Hope this helps
0 -
Hello @g.suhharukov
Please try to run the example "as is" as suggested by my colleague @zoya faberov.
I also strongly suggest you check the following WebSocket API resources which will give you a better detail of ERT in Cloud and WebSocket API:
- Introduction and Connect to Elektron Real Time in Cloud sections of WebSocket API tutorials.
- Refinitiv Real-Time - Optimized Install and Config Guide document in WebSocket API document page.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 251 ETA
- 556 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 645 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 916 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛