question

Upvotes
Accepted
18 0 1 6

HTTP error 443 with RKD python API trying to authenticate

Hello,

I'm getting the following error

HTTPSConnectionPool(host='api.rkd.refinitiv.com', port=443): Max retries exceeded with url: /api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f133695b748>: Failed to establish a new connection: [Errno -2] Name or service not known'))


when trying to authenticate , following https://developers.refinitiv.com/en/api-catalog/refinitiv-knowledge-direct/refinitiv-knowledge-direct-api-rkd-api/tutorials , https://github.com/Refinitiv-API-Samples/Example.TRKD.Python.HTTPJSON/blob/master/trkd_authen.py with my new credentials.

The exception is raised on the very first attempt, obviously 'max retries' is not a cause.

What could be the reason, please?

rkd-apirkd
icon clock
10 |1500

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

Upvotes
Accepted
13k 32 12 18

Hello @RG1,

The number 443 is not the error, but rather the port number that your application has to connect to (HTTPS).

I just tried the sample and can confirm that the code and the endpoints are correct and was able to successfully get an access token. From the error message it looks like that your application does not have a network route to api.rkd.refinitiv.com. Can you please confirm that you are indeed able to reach this URL?

It might be easier to use a network took like CURL and see if there is a connection:

curl -X POST https://api.rkd.refinitiv.com/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1 -H "content-type: application/json;charset=utf-8" -d '{"CreateServiceToken_Request_1": { "ApplicationID": "****", "Username": "****", "Password": "*****" }}'

If you are unable to connect, please contact your network team to figure out firewall/proxy information.

icon clock
10 |1500

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

Upvotes
18 0 1 6

Thank you. Yes, indeed i get "Couldn't resolve host 'api.rkd.refinitiv.com' with curl. Apologies for incorrectly formed question.


icon clock
10 |1500

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

Click below to post an Idea Post Idea