question

Upvotes
Accepted
39 4 5 12

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/thomson-reuters-knowledge-direct-trkd/thomson-reuters-knowledge-direct-api-trkd-api/learning , 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 512.0 KiB each and 1.0 MiB total.

@RG1

Hi Rimma,


Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply?

This will guide all community members who have a similar question.


Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
22.1k 59 14 21

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 512.0 KiB each and 1.0 MiB total.

Upvotes
39 4 5 12

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