question

Upvotes
Accepted
3 1 2 5

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?

tick-history-rest-apirequest-token
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
13.7k 26 8 12

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

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
3 1 2 5

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)

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.

@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"})

Click below to post an Idea Post Idea