Using API to download Extractions on Tick History
Hello,
Once the instrument list, report template and schedule has been set up using GUI, would it be possible to use REST API just to download the Extracted Files on Tick History?
If so, is there a documentation about this step? Also, where do I get the job id when sending a request?
Thank you!
Best Answer
-
I assumed that you already have a schedule created on the DSS server. For example:
To use the REST API to get the extracted data of the schedule, you need to know the schedule ID of that schedule. You can use the following endpoint with the HTTP GET method to get the schedule ID from the schedule name.
Extractions/ScheduleGetByName(ScheduleName='DailySchedule')
The output will contain the schedule ID in the "ScheduleId" field.
{
"@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#Schedules/$entity",
"ScheduleId": "0x07b1b9370a7d1892",
"Name": "DailySchedule",
"OutputFileName": "DailyOutput",
"TimeZone": "GMT Standard Time",
"Recurrence": {
...
}Then, we can use the ScheduleId with the following endpoint and the HTTP GET method to get the completed report extractions.
Extractions/ReportExtractionGetCompletedByScheduleId(ScheduleId='0x07b1b9370a7d1892')
Or
Extractions/Schedules('0x07b1b9370a7d1892')/LastExtractionThe output will contain the "ReportExtractionId" field.
{
"@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#ReportExtractions/$entity",
"ReportExtractionId": "542712727",
"ScheduleId": "0x07b1b9370a7d1892",
"Status": "Completed",
"DetailedStatus": "Done",
"ExtractionDateUtc": "2021-09-03T02:34:09.026Z",
"ScheduleName": "DailySchedule",
"IsTriggered": false,
"ExtractionStartUtc": "2021-09-03T02:34:10.000Z",
"ExtractionEndUtc": "2021-09-03T02:34:13.000Z"
}Next, we can use the "ReportExtractionId" to get a list of files in that report by using the following endpoint with the HTTP GET method.
Extractions/ReportExtractions('542712727')/Files
The output will contain a list of files.
"value": [
{
"ExtractedFileId": "VjF8fDg4MTM0NTI2MA",
"ReportExtractionId": "542712727",
"ScheduleId": "0x07b1b9370a7d1892",
"FileType": "RicMaintenanceNote",
"ExtractedFileName": "DailyOutput.ric.csv",
"LastWriteTimeUtc": "2021-09-03T02:34:13.068Z",
"ContentsExists": true,
"Size": 90,
"ReceivedDateUtc": "2021-09-03T02:34:13.068Z"
},
{
"ExtractedFileId": "VjF8fDg4MTM0NTI0OA",
"ReportExtractionId": "542712727",
"ScheduleId": "0x07b1b9370a7d1892",
"FileType": "Full",
"ExtractedFileName": "DailyOutput.csv",
"LastWriteTimeUtc": "2021-09-03T02:34:12.947Z",
"ContentsExists": true,
"Size": 708,
"ReceivedDateUtc": "2021-09-03T02:34:12.947Z"
},
{
"ExtractedFileId": "VjF8fDg4MTM0NTI0Nw",
"ReportExtractionId": "542712727",
"ScheduleId": "0x07b1b9370a7d1892",
"FileType": "Note",
"ExtractedFileName": "DailyOutput.csv.notes.txt",
"LastWriteTimeUtc": "2021-09-03T02:34:13.071Z",
"ContentsExists": true,
"Size": 1634,
"ReceivedDateUtc": "2021-09-03T02:34:13.071Z"
}
]Typically, each report has three file types (Note, Full, and RicMaintenanceNote). The extracted data is available in the Full file type.
Finally, you need to use the ExtractedFileId field to get the file by using the following endpoint with the HTTP GET method.
Extractions/ExtractedFiles('VjF8fDg4MTM0NTI0OA')/$value
In summary, there are four steps to use the REST API to retrieve the data extracted from the schedule.
1. Get the ScheduleId from the schedule name
2. Get the completed report extractions (ReportExtractionId) from the ScheduleId
3. Get the list of files (ExtractedFileId) in the report extraction
4. Get the file from the ExtractedFileId
0
Answers
-
Thank you! This is helpful.
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 中文论坛