question

Upvotes
Accepted
262 8 9 15

Is it possible to download data that I extracted using Tick History v2 directly onto a Linux server

I was wondering whether it is possible to download data that I extracedt using Tick History v2 directly ont a linux server with, for example, linux command "wget".

tick-history-rest-apilinux
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
11.3k 25 8 13

@Beera.Rajesh

You can use the "wget" command to download extracted file from TRTH V2. However, you need to specify "Authorization: <Token>" in the header. Below is the sample of command.

wget -d --header="Authorization:Token_<token>" https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/RawExtractionResults\(\'0x05c81050d50b3036\'\)/\$value -O "output.csv.gz"
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.

@veerapath : Client has come back asking Could you please explain what the <Token> refers to. For example if my username is "Dominik" and my password is "Password" what would be the wget command?

@Beera.Rajesh: The authentication token is required by all API calls. A generated token is valid for 24 hours and can be requested from API endpoint RequestToken; passing in userID and password.

On linux you can use CURL to get a token by invoking the command:

curl -i -X POST -k -H "Content-Type: application/json" -H "Prefer: respond-async" -d "{\"Credentials\": { \"Username\": \"***\", \"Password\": \"***\"}}" https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken
Upvotes
11.3k 25 8 13

@Beera.Rajesh

The token is an authentication token returned from authentication request. It needs to be added to each subsequent API request. For more informaiton, please see this tutorial.

The wget command I provided is a part of REST API which retreives extracted data from TRTH. Please see the "Retrieve the data from the server" step in this tutorial for the Schedule extraction and "Retrieve data - HTTP request" in this tutorial for the On Demand extraction.

However, to extract data , the client still needs to use TRTH REST API to create On Demand and Scehdule extraction or Web GUI to create Schedule extraction.

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
50 9 12 20

invalid user name password error is occuring when usingg curl command with the syntax recommended

curl -i -X POST -k -H "Content-Type: application/json" -H "Prefer: respond-async" -d "{\"Credentials\": { \"Username\": \"******\", \"Password\": \"*******\"}}" https://<Internal ip>/RestApi/v1/Authentication/RequestToken

Response

HTTP/1.1 401 Unauthorized Set-Cookie: DSSAPI-COOKIE=R1530954311; path=/

Cache-Control: no-cache

Pragma: no-cache Content-Type: application/json; charset=utf-8

Expires: -1

Server: Microsoft-IIS/7.5

WWW-Authenticate: Basic

X-Request-Execution-Correlation-Id: a36a4bfa-4fff-425e-b0cb-aedb573883e0

X-App-Id: Custom.RestApi

X-App-Version: 11.1.534.64 Date: Wed, 12 Jul 2017 13:46:48 GMT

Content-Length: 52

{"error":{"message":"Invalid username or password"}}

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.

Are you using your TRTH username and password in CURL command where it says ****?

Click below to post an Idea Post Idea