C# SDK - Support for AWS downloads

Hello,
we are using the C# SDK and we were wondering if there are any plans to introduce the ability to get TRTH results over AWS as announced in the TRTH release notes 11.1.5.5
Thanks
Best Answer
-
@Giovanni.Condello, it is possible to do that using the C# SDK.
In the code you must set the x-direct-download header, it would look somewhat like this:
var context = new StandardExtractionsContext(new
Uri("https://hosted.datascopeapi.reuters.com/RestApi/v1/"), "<your user id>", "<your password>");
context.DefaultRequestHeaders.Add("x-direct-download", "true");
var stream = context.UserPackageDeliveryOperations.GetReadStream("<packageDeliveryId>");
// Read Stream here…I have not yet tried this, but will attempt to make a sample in a near future, which I'll make available for download when available.
0
Answers
-
You can also use the following code to set the X-Direct-Download header. This will set the header once for a next API call.
Func<System.Collections.Generic.Dictionary<string, string>> directDownload = delegate()
{
System.Collections.Generic.Dictionary<string, string> header = new System.Collections.Generic.Dictionary<string, string>();
header.Add("X-Direct-Download", "true");
return header;
};
ExtractionsContext.SetRequestHeaders(directDownload);
using (var response = ExtractionsContext.RawExtractionResultOperations.GetReadStream(result))0 -
Hi Oliver!
Yes it did work in the end. Thanks all for the support
BR
Giovanni
0 -
@Giovanni.Condello, here is a tested code snippet:
//Set header for direct download from AWS:
extractionsContext.DefaultRequestHeaders.Add("x-direct-download", "true");
//Save data stream to file:
DssStreamResponse streamResponse = extractionsContext.GetReadStream(extractionResult);
using (var fileStream = File.Create(dataOutputFile))
streamResponse.Stream.CopyTo(fileStream);
//Reset header after direct download from AWS:
extractionsContext.DefaultRequestHeaders.Remove("x-direct-download");Hope this helps. I will soon update the C# samples and tutorials to include AWS downloads.
0 -
@Giovanni.Condello, the TRTH C# code samples and C# Tutorials 2 (VBD), 4 (scheduled extraction) and 5 (On Demand extraction) have been updated to allow use of AWS.
This completes what was previously done for the Java samples, which now also allow AWS downloads.
All this is available in the Developer Community, in the TRTH REST API section.
0 -
@Giovanni.Condello, an article on AWS downloads has just been published. You might find it useful to understand this new feature.
0 -
I need your advice on clients question
How do I use AWS Direct header in C# SDK, had shared the below
var context = new StandardExtractionsContext(new
Uri("https://hosted.datascopeapi.reuters.com/RestApi/v1/"), "<your user id>", "<your password>");
context.DefaultRequestHeaders.Add("x-direct-download", "true");
var stream = context.UserPackageDeliveryOperations.GetReadStream("<packageDeliveryId>");
You can also use the following code to set the X-Direct-Download header. This will set the header once for a next API call.
Func<System.Collections.Generic.Dictionary<string, string>> directDownload = delegate()
{
System.Collections.Generic.Dictionary<string, string> header = new System.Collections.Generic.Dictionary<string, string>();
header.Add("X-Direct-Download", "true");
return header;
};
ExtractionsContext.SetRequestHeaders(directDownload);
using (var response = ExtractionsContext.RawExtractionResultOperations.GetReadStream(result))Client wants to now:-
Is this flag help with some persisted query results?
In fact I'm using ExtractionsContext, not StandardExtractionsContext, and there is no such property DefaultRequestHeaders.
And results for each request are not persisted (no extracted files) in your system.
Does it mean, I don't need this DirectDownload option?
0
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
- 685 Datastream
- 1.4K DSS
- 620 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
- 254 ETA
- 557 WebSocket API
- 38 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
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 1.9K Refinitiv Data Platform
- 658 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
- 229 TRKD
- 917 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 中文论坛