Extractions/RawExtractionResults AWS download - getting 200 OK with data rather than 302 redirect wh
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 -
Sorry, I feel like I have followed all the steps and am still getting a 200 rather than a 302. Is there an example Job ID you can share?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 -
Hi
@zoya.farberov - 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.0 -
Thanks
@jirapongse.phuriphanvichai0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛