question

Upvotes
Accepted
3 3 5 6

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

Hello @rahul_srivastava,

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

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hello @rahul_srivastava,

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

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your 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
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 512.0 KiB each and 1.0 MiB total.

Upvotes
3 3 5 6

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 512.0 KiB each and 1.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"})

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.