TRTH REST : Download a file with Postman

I use direct HTTP requests / C++
It seems much more difficult to download the results in a file than with the TRTH SOAP version.
Once a request is completed, is there a simple HTTP request which allows to download a file on my own machine ?
I tried this with Postman :
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractedFiles(‘VjF8MHgwNWNjOWMxYWUwZmIyZjk2fA’)/$value
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ExtractedFiles",
"value": [
{
"ExtractedFileId": "VjF8MHgwNWNjOWMxYWY1N2IyZjk2fA",
"ReportExtractionId": "2000000001260285",
"ScheduleId": "0x05cc9c10851b2f86",
"FileType": "Note",
"ExtractedFileName": "_OnD_0x05cc9c10851b2f86.csv.gz.notes.txt",
"LastWriteTimeUtc": "2017-07-18T12:31:45.620Z",
"ContentsExists": true,
"Size": 1186,
"ReceivedDateUtc": "2017-07-18T12:31:45.620Z"
},
{
"ExtractedFileId": "VjF8MHgwNWNjOWMxYWUwZmIyZjk2fA",
"ReportExtractionId": "2000000001260285",
"ScheduleId": "0x05cc9c10851b2f86",
"FileType": "Full",
"ExtractedFileName": "_OnD_0x05cc9c10851b2f86.csv.gz",
"LastWriteTimeUtc": "2017-07-18T12:31:44.000Z",
"ContentsExists": true,
"Size": 2029220
}
]
}
Best Answer
-
The error message says the URL is invalid. Looking at it very closely I think I found what is wrong with it. The URL should use the following character around the file ID: '
But your URL uses ‘ and ’, these are 2 different characters. This can happen when pasting in/out of word.
Try this, it should work:
0
Answers
-
I'm guessing you are doing a scheduled extraction, using an instrument list, report template and schedule. Please correct me if my assumption is wrong.
First of all, to retrieve the data, you do not need to provide a filename but an extracted file ID, so you are perfectly correct in making a call to https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractedFiles(‘VjF8MHgwNWNjOWMxYWUwZmIyZjk2fA’)/$value, that is the correct way to retrieve the file contents.
I don't know why you got a 400 Bad request. Did you do a GET or a POST to this URL ? You need to do a GET. If you did use a GET, then could you post the error that was delivered with the 400 Bad Request ? It will help to debug.
Second, Postman will not save the file to disk. It will automatically decompress the contents, and display them on screen (there are limits to the file size Postman can handle, so don't request too much data otherwise it will hang).
We do not have C++ samples, but if you download the Java samples (from the downloads tab) and look at one of the three "DSS2ImmediateSchedule" samples you will easily understand the logic, and how we save the compressed data file to disk. I hope this helps, even if the programming language is not the same.
For more details, the entire workflow of a scheduled extraction is described in REST API Tutorial 12. If you download the Postman collection (from the downloads tab), install it and its associated environment, you can also run all the calls of this tutorial to see how Postman should react.
0 -
Yes ! : scheduled / instrument list / template
Before jumping on my C++ compiler, I wanted to go through the whole process.
The details of the error I got was :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
</HEAD>
<BODY>
<h2>Bad Request - Invalid URL</h2>
<hr>
<p>HTTP Error 400. The request URL is invalid.</p>
</BODY>
</HTML>To be honest, I do not understand at all.
BTW, when I asked for a RawExtractionResults(), it works perfectly and my Postman browser printed the correct flow.
I am going to look at your examples in Java. If you could post an example in C++ for downloading files, I think it will be much appreciated.
Thank you
0 -
OK
It works
Thank you very much
0 -
Great, happy to hear that :-)
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 630 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 86 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛