For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
11 5 6 6

get compressed output data file.

Now I have a template using REST API like below:

How can I add the codes to make the output file compressed, just like xxx.csv.gz?

JSONOrderedObject reportTemplateJSONObject = new JSONOrderedObject() .put("@odata.type", "#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.HistoricalReferenceReportTemplate") .put("ShowColumnHeaders", true)

.put("Name", reportTemplateName )

.put("Headers", new JSONArray() )

.put("Trailers", new JSONArray() )

.put("ContentFields", new JSONArray() .put( new JSONObject() .put("FieldName", "RIC") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Change Date") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Strike Price") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Expiration Date") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Exercise Style") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "OCC Code") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Tick Value") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Method of Delivery") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Asset Category") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "CFI Code") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "ISIN") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Place of Listing Flag") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Market Segment Name") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Start date") .put( "Format", JSONObject.NULL)) ) .put("Condition", new JSONOrderedObject() .put( "StartDate", StartDate + "T00:00:00.000-00:00" ) .put( "EndDate", EndDate + "T00:00:00.000-00:00" ));

dss-rest-apidatascope-selectdssrest-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
11.3k 25 9 14

You can add "CompressionType": "GZip" to get compressed output data file for HistoricalReferenceReportTemplate. The code should be:

JSONOrderedObject reportTemplateJSONObject = new JSONOrderedObject() 
.put("@odata.type", 
"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.HistoricalReferenceReportTemplate")
 .put("ShowColumnHeaders", true)
 .put("CompressionType", "GZip")

You can find all available properties in the REST API Reference Tree

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.