how to make scheduled extraction

nraval
nraval Newcomer

Hi. I have a instrument list, report template, and recurring schedule setup through GUI. All I want to do is use the API to extract the file. How can I find the file to extract, and extract it at certain time during the day once the file is available?

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hello @nraval,

    I would try to verify that there is a completed extraction(s) specifically, for this schedule, run "Get Completed By Schedule ID" to see all the completed extractions that were scheduled, :

    {{protocol}}{{host}}{{api}}Extractions/ReportExtractionGetCompleted 

    Do you see schedule IDs of completed schedules? Do you see scheduleID of the schedule you require? For example, I see:

    {
        "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ReportExtractions",
        "value": [
            {
                "ReportExtractionId": "2000000209996076",
                "ScheduleId": "MYSCHEDULEID",
                "Status": "Completed",
                ...
            },
            {
                "ReportExtractionId": "2000000210323640",
                "ScheduleId": "MYSCHEDULEID2",
                "Status": "Completed",
                ...

    Try the call with these schedule Ids:

    {{protocol}}{{host}}{{api}}Extractions/Schedules('{{scheduleId}}')/LastExtractio 

    Should see the status in the format:

    {
        "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ReportExtractions/$entity",
        "ReportExtractionId": "2000000209996076",
        "ScheduleId": "MYSCHEDULEID",
        "Status": "Completed",
        "DetailedStatus": "Done",
        "ExtractionDateUtc": "2021-01-18T16:00:00.000Z",
        "ScheduleName": "myNonImmediateSchedule",
        "IsTriggered": false,
        "ExtractionStartUtc": "2021-01-18T16:00:03.176Z",
        "ExtractionEndUtc": "2021-01-18T16:00:17.656Z"
    }

    One reason I can think of is you would see the empty result if there is no completed extractions per this schedule

Answers