HTTP error 443 with RKD python API trying to authenticate

RG1
RG1 Explorer

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?

Tagged:

Best Answer

  • Gurpreet
    Gurpreet admin
    Answer ✓

    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.

Answers

  • RG1
    RG1 Explorer

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