how to make scheduled extraction
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
-
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
0
Answers
-
Hello @nraval,
For working with GUI Control generated extractions, I would like to suggest reviewing REST API Tutorial 12: GUI control calls.
It gives all the fundamentals of working with GUI controls and details how to:
- Check the status of a scheduled extraction (to know if it is available and getting ExtractionId for the next step)
- Retrieve the extraction report (by ExtractionId)
The tutorial retrieves by LastExtraction, which is the most common use case.
Your use case may require you to do more, if this is not the last extraction on the schedule, you may need to use ReportExtractionGetCompletedByScheduleId request, to examine the completed extractions for the schedule and determine the ones you wish to retrieve the results for using the same approach.
0 -
In the method GetCompletedByScheduleId, how do I get the id? I have an instrument list, report template, and schedule that are not going to change. All I want to do is download the extracted file? in all the sample code, you have to create an instrument list, report template and schedule.
0 -
Hello @nraval,
If you do not know the scheduleId of the schedule you are looking for, via API you can run
GET /Extractions/Schedules
to obtain all existent schedule Ids and determine the id of the one you are looking to extract.
The tutorial shows how to recreate instrument list, report template and schedule in code, you do not need all this, as you already have those. So likely, you just need steps
"Check Status"
and, once completed, "Retrieve Extraction Report".
Makes sense?
0 -
Hello @nraval,
Actually, if you know the name of your schedule (from GUI -> Schedules) a better approach may be
{{protocol}}{{host}}{{api}}Extractions/ScheduleGetByName(ScheduleName='myImmediateSchedule')
This will return the schedule Id for the submitted schedule name, for example:
{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Schedules/$entity",
"ScheduleId": "0x060987291f2b3036",
"Name": "myImmediateSchedule",
...0 -
ok great. Let me give that a try! Thanks!
0 -
Hello @nraval,
GET URL does not not look right, looks off, and that is consistent with "Unmapped Request", this error usually comes up when URL can not be found.
Let us together verify each step we have discussed:
1. You run ScheduleGetByName and obtained ScheduleId for your shcedule
2. You check schedule status, as in tutorial
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/Schedules('0x05a2b98d233b3036')/LastExtraction
and
- Status is ok = 200 (otherwise it is not ready to extract yet, repeat periodically)
- Once status=200, from the result, you obtain ExtractedFileID such as
{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ExtractedFiles
"value":
"ExtractedFileId": "VjF8MHgwNWEyYjk5ODRiNmIyZjk2fA
"ReportExtractionId": "2000000000197524
"ScheduleId": "0x05a2b98d233b3036",3. You pass ExtractedFileId into extract the result as per tutorial:
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractedFiles(';VjF8MHgwNWEyYjk5ODRiNmIyZjk2fA')/$value
0 -
Yes. But the lastextraction property is null even though I see an extracted file associated with the file
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
- 684 Datastream
- 1.4K DSS
- 615 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
- 249 ETA
- 554 WebSocket API
- 37 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
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 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
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 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 中文论坛