TRTH REST API requesttoken

I am using RSET API for TRTH v2. To get the token I am trying to access https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken But for some reason this URI never opens. I have tried post request using python and also have tried to simply open that URI on internet explorer. Can you please suggest?

Best Answer

  • rahul_srivastava,

    Opening that link directly in a browser will not work.

    Have you tried the Post request in Postman, as described in the REST API Tutorials intro and following tutorial ?

    Working Python samples are also available under the downloads tab, their first step is to request the authentication token.

    Please note: there was a Service Alert on TRTH v2 earlier today, which might have been the cause of failed requests, you might want to retry now, the servers seem back to normal.

Answers

  • Hi, Christiaan,

    I have tried on python but it gives me this error -

    requests.exceptions.ConnectionError: HTTPSConnectionPool(host='hosted.datascopeapi.reuters.com', port=443): Max retries exceeded with url: /RestApi/v1/Authentication/RequestToken (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000000000385BE80>: 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',))

    My code snippet is -

    import requests


    requestUrl ="https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken"

    requestHeaders={"Prefer":"respond-async","Content-Type":"application/json"}

    requestBody={"Credentials": {"Username": "**********","Password": "**********"}}

    authenticationRequest = requests.post(requestUrl, json=requestBody,headers=requestHeaders)

  • rahul_srivastava, are you behind a proxy ? What you observe looks similar to the topic of this query ...

  • the query link in your last response says I don't have permission to go there....can you please grant me to check that link?

  • Hi, I used proxies method and it worked for me. Thanks for you help

    authenticationRequest = requests.post(requestUrl, json=requestBody,headers=requestHeaders,proxies={"https":"proxy.statestr.com"})