How to list all extractions created with ExtractRaw?

d.alishev
d.alishev Newcomer

Hi!

I'm following 'Tick History Rest Api Guide' to download history market data. I made post request ('https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractRaw') with body:

{"ExtractionRequest":
{
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest",
"ContentFieldNames": ["High", "Last", "Low", "Open", "Volume"],
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [{"Identifier": "CLZ2", "IdentifierType": "Ric"}],
"UseUserPreferencesForValidationOptions": "False"
},
"Condition": {
"MessageTimeStampIn": "GmtUtc",
"ReportDateRangeType": "Range",
"QueryStartDate": "2022-08-22T00:00:00Z",
"QueryEndDate": "2022-08-23T23:59:00Z",
"DisplaySourceRIC": "True",
"SummaryInterval": "OneMinute"
}
}
}

I got ExtractionId in the respond ('0x0830ea3024a33b1c'). So, I have two questions:

  1. How to get all extractions made from me? I tried get request https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ReportExtractions but result is empty:
{
    "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#ReportExtractions",
    "value": []
}

2. How to delete extraction ('0x0830ea3024a33b1c') and all related files after I don't need it anymore?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @d.alishev

    Sorry for the issue you are facing, let me see if I can help you in resolving this.

    You can use the /Jobs/Jobs endpoint with the GET method to get all extracted jobs.

    The output looks like this:

     {
    "JobId": "0x0830eadfb9933af4",
    "UserId": xxx,
    "Status": "Completed",
    "StatusMessage": " ",
    "Description": "TickHistoryTimeAndSalesReportTemplate Extraction",
    "ProgressPercentage": 0,
    "CreateDate": "2022-10-04T01:32:22.826Z",
    "StartedDate": "2022-10-04T01:32:22.826Z",
    "CompletionDate": "2022-10-04T01:35:56.156Z",
    "MonitorUrl": "https://selectapi.datascope.refinitiv.com/restapi/v1/Extractions/ExtractRawResult(ExtractionId='0x0830eadfb9933af4')"
    },

    You can cancel an In Progress extraction by using the DELETE method with the Extractions/ExtractRawResult(ExtractionId='<job id>') endpoint.

    1664852496786.png

    The status of canceled jobs will be PendingCancellation.

    {
        "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#Jobs",
        "value": [
            {
                "JobId": "0x08314caddb733ba3",
                "UserId": xxx,
                "Status": "PendingCancellation",
                "StatusMessage": "PendingCancellation",
                "Description": "TickHistoryTimeAndSalesReportTemplate Extraction",
                "ProgressPercentage": 0,
                "CreateDate": "2022-10-04T02:59:10.086Z",
                "StartedDate": "2022-10-04T02:59:10.086Z",
                "MonitorUrl": "https://selectapi.datascope.refinitiv.com/restapi/v1/Extractions/ExtractRawResult(ExtractionId='0x08314caddb733ba3')&quot;
            },
    ...

    You can get a list of extracted files from the /Extractions/ExtractedFiles endpoint with the GET method. The output looks like this:

        "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#ExtractedFiles",
        "value": [
            {
                "ExtractedFileId": "VjF8MHgwODMwZjU5ZTU4MzMzYjNkfA",
                "ReportExtractionId": "2000000455842161",
                "ScheduleId": "0x08314caddb733ba3",
                "FileType": "Note",
                "ExtractedFileName": "_OnD_0x08314caddb733ba3.csv.gz.notes.txt",
                "LastWriteTimeUtc": "2022-10-04T03:02:17.230Z",
                "ContentsExists": true,
                "Size": 953,
                "ReceivedDateUtc": "2022-10-04T03:02:17.230Z"
            },
            {
                "ExtractedFileId": "VjF8MHgwODMwZTk2NDYxNzMzYWYwfA",
                "ReportExtractionId": "2000000455817736",
                "ScheduleId": "0x0830eadf7fb33af6",
                "FileType": "Note",
                "ExtractedFileName": "_OnD_0x0830eadf7fb33af6.csv.gz.notes.txt",
                "LastWriteTimeUtc": "2022-10-04T01:45:36.740Z",
                "ContentsExists": true,
                "Size": 953,
                "ReceivedDateUtc": "2022-10-04T01:45:36.740Z"
            },

    Then, you can delete a file by using the DELETE method with the /Extractions/ExtractedFiles('<ExtractedFileId>') endpoint.

    1664852873469.png

    For more information, please refer to the API Reference Tree.

    I hope this will help.

Answers