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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvote
Accepted
20 1 2 8

DSS - Extracted files - Clean up

Is there any api or a way to remove 'Extracted files' with additional information(ScheduleId, ReportExtractionId... )? What our team wants to do is remove specific file on 'Extracted files' PROGRMATICALLY.

In document below, I just found about 'Clean up' section, but there is no about 'Extracted files'. (Only about instrument list, a report template and a schedule)

- https://developers.refinitiv.com/en/api-catalog/datascope-select/datascope-select-rest-api/tutorials#rest-api-tutorial-10-gui-control-calls-immediate-extract

dss-rest-apidatascope-selectdss
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
462 9 7 14

Hi,

I would recommend using the .NET Example Application (C# / Direct HTTP - executable code examples):

https://hosted.datascopeapi.reuters.com/RestApi.Help/Home/ExampleAppInstructions

(from landing page: https://hosted.datascopeapi.reuters.com/RestApi.Help/Home/Index - DSS credentials required)

Once unzipped use ...\RESTAPIExampleApplication\bin\Release\Dss.Api.Examples.exe

Login into DSS App using DSS credentials

The "Schedule Extractions" (section) > "Cleanup" example should help here, particularly this part of the code:

//Delete the extracted files, schedule, instrument list and report template. See the "Cleanup" example for
//the various steps involved with cleanup. NOTE: It is a good idea to clean up the extracted files (Report Extractions)
//once you have downloaded the results. If the schedule is not immediate (i.e. recurring), you want to keep the 
//instrument list, report template and schedule around.
if (schedule.ScheduleId != null)
{
 //Get the extractions so that we can delete the extraction files
 var scheduleExtractions = ExtractionsContext.ReportExtractionOperations.GetByScheduleId(schedule.ScheduleId);
foreach (var reportExtraction in scheduleExtractions) { //Get all the files for this extraction ExtractionsContext.LoadProperty(reportExtraction, "Files");
//Use the DeleteMultiple method to delete all the files associated with the schedule var fileIds = reportExtraction.Files .Where(f => f.ContentsExists).Select(f => f.ExtractedFileId).ToList(); if (fileIds.Count > 0) ExtractionsContext.ExtractedFileOperations.DeleteMultiple(fileIds); }

This landing page can also be found via the DSS GUI: https://hosted.datascope.reuters.com/DataScope/ > "Help" (dropdown) > "REST API Help"

Best regards,

Gareth

icon clock
10 |1500

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

Click below to post an Idea Post Idea