Extractions/RawExtractionResults AWS download - getting 200 OK with data rather than 302 redirect...
... when using - X-Direct-Download
Hi,
I'm using the Extractions/RawExtractionResults method with X-Direct-Download set to true to try to get a 302 redirect to the AWS S3 link. I have tried this using Postman and .Net Core. I have followed the guides at:
- https://developers.refinitiv.com/en/article-catalog/article/using-microsoft-net-core-tick-history-rest-api
- https://developers.refinitiv.com/en/article-catalog/article/boost-tick-history-downloads-with-aws
private HttpClient Client = new HttpClient(new HttpClientHandler
{
AllowAutoRedirect = false,
});
var uri = new Uri($"https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/RawExtractionResults('{job.JobId}')/$value");
var request = new HttpRequestMessage(HttpMethod.Get, uri);
request.Headers.Add("Authorization", $"Token {authToken}");
request.Headers.Add("Prefer", "respond-async");
request.Headers.Add("X-Direct-Download", "true");
var result = await this.Client.SendAsync(request);
I expect result to have a 302 status code with the redirect to the S3 bucket in the header but it always has a 200 with the actual data. I have also tried using postman with automatic redirects turned off.
UPDATE
I want to clarify what I am trying to achieve and the steps I am following:
1) Get Authentication token using /Authentication/RequestToken endpoint and username/password - no issues.
2) Use the token to get a list of completed jobs from the /Jobs/JobGetCompleted endpoint - no issues.
3) Use a job ID obtained in step 2) to get the extraction data from using the Extractions/RawExtractionResults endpoint. This is where I am having issues. The endpoint gives a 200 response and returns the data which is what I would expect. The problem is when I try to use the "X-Direct-Download" header. I still get a 200 response and the data rather than a 302 redirect.
This happens when auto redirects are turned off in Postman and when redirects are disabled in C# as in the code sample above.
Best Answer
-
Refer to the RefinitivTick History User Guide, AWS download supports for Tick History Time and Sales, Tick History Market Depth, Tick History Intraday Summaries, and Tick History Raw reports.
Please check if that job is in the AWS-supported templates and if it is a scheduled or on-demand extraction.
0
Answers
-
Hello @BenL ,
Believe you should be able to do work it this way.
I have just tested with Postman, the quickest for me, following the relevant section in article Boost Tick History downloads with AWS
1. Changing the setting:
For my test, I have used RTH Tutorial 4.
2. 4b - Requested extraction - status was 202
3. 4c - Checked status, till status became 200
4. 4d - Requested get tick data, but adding AWS download now:
I think the last step is where the difference may be, and hope this helps
0 -
0
-
Hello @BenL
Sharing the jobId will not help, I believe, as you will not be able to access my job, only yours.
Can we try the following:
Is your Postman set to disable re-direct as described in the article and my previous answer?
Do you have any job, that you have created, has completed, and are able to get result of currently, from Postman successfully, or please create one?
Next, I am able to run request:
{{protocol}}{{host}}{{api}}Extractions/RawExtractionResults('{{jobId}}')/$value
When I run it without x-direct the result is 200 + data
When I run it with x-direct the result is
Can you please try the same, do you have a recent Postman, mine is not the very latest but is quite recent Postman v8.6.2, perhaps this could be the difference as well.
Let us know if you are able to reproduce?
0 -
I am getting the completed jobs from: https://hosted.datascopeapi.reuters.com/RestApi/v1/Jobs/JobGetCompleted
is this not correct?
0 -
Hello @BenL ,
Let me step back, to make sure that I fully understand your requirement:
Do you require to obtain the list of the complete jobs? Then please use JobGetCompleted call to do this.
Are you interested in downloading a result of your job over AWS, and using x-direct-download header, but still failing to do so? Then please test via Postman as suggested to verify you are able to do so and let us know what you observe.
To better understand the semantics of DSS REST requesting, please refer to RTH REST tutorials , especially tutorials REST API Tutorials Introduction and REST API Tutorial 3: On Demand data extraction workflow.
0 -
@zoya faberov - I have updated my question explaining what I am trying to do. I get the list of completed jobs from JobGetCompleted and then what to use the job IDs returned to get an S3 download link.Hi0
-
Thanks0
Categories
- All Categories
- 3 Polls
- 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
- 615 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
- 251 ETA
- 555 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
- 643 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 916 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛