Tick History Relative Query
Hello,
We have a Tick History client trying to extract data using Relative query but they get an error message and need your help to fix the code.
{
"@odata.type": "#DataScope.Select.Api.Extractions.ReportTemplates.TickHistoryTimeAndSalesReportTemplate",
"Name": "Test Report",
"ContentFields": [
{
"FieldName": "Quote - Ask Price",
"Format": null
},
{
"FieldName": "Quote - Ask Size",
"Format": null
}
],
"Condition": {
"MessageTimeStampIn": "GmtUtc",
"ApplyCorrectionsAndCancellations": true,
"ReportDateRangeType": "Relative",
"RelativeStartDaysAgo": 1,
"RelativeEndDaysAgo": 0,
"RelativeStartTime": "10:00:00.000",
"RelativeEndTime": "23:59:59.999",
"DateRangeTimeZone": "Local Exchange Time Zone",
"DisplaySourceRIC": false
}
}
And when I do this I get back a 201 status code indicating it worked, but if I then query the report that I just created (via /RestApi/v1/Extractions/ReportTemplateGetByName), the returned condition looks like this:
{
"@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#ReportTemplates/DataScope.Select.Api.Extractions.ReportTemplates.TickHistoryTimeAndSalesReportTemplate/$entity",
"@odata.type": "#DataScope.Select.Api.Extractions.ReportTemplates.TickHistoryTimeAndSalesReportTemplate",
"ReportTemplateId": "0x07c951e55cdd4f12",
"ShowColumnHeaders": true,
"CompressionType": "GZip",
"CreateDate": "2021-11-15T10:33:24.006Z",
"LastChangedDate": "2021-11-15T10:33:24.006Z",
"Name": "Test Report",
"OutputFormat": "CommaSeparatedValues",
"ReportFieldCount": 2,
"Delimiter": "None",
"DeliveryType": "None",
"Destination": "",
"TemplateTypeCode": "THT",
"Headers": [],
"Trailers": [],
"ContentFields": [
{
"FieldName": "Quote - Ask Price",
"Justification": "Center",
"Label": "",
"WidthStyle": "VariableWidth",
"Format": {
"@odata.type": "#DataScope.Select.Api.Extractions.ReportTemplates.ContentFieldNumberFormat",
"DecimalPlaces": 9,
"DecimalSeparator": "Period",
"IntegerPlaces": 18,
"UseLeadingZero": false,
"NegativeSignPosition": "Before",
"ThousandSeparator": "Comma",
"UseThousandSeparator": true,
"UseTrailingZero": false
}
},
{
"FieldName": "Quote - Ask Size",
"Justification": "Center",
"Label": "",
"WidthStyle": "VariableWidth",
"Format": {
"@odata.type": "#DataScope.Select.Api.Extractions.ReportTemplates.ContentFieldNumberFormat",
"DecimalPlaces": 9,
"DecimalSeparator": "Period",
"IntegerPlaces": 18,
"UseLeadingZero": false,
"NegativeSignPosition": "Before",
"ThousandSeparator": "Comma",
"UseThousandSeparator": true,
"UseTrailingZero": false
}
}
],
"Condition": {
"SortBy": "SingleByRic",
"MessageTimeStampIn": "LocalExchangeTime",
"TimeRangeMode": "",
"ApplyCorrectionsAndCancellations": false,
"ReportDateRangeType": "NoRange",
"Preview": "None",
"ExtractBy": "Ric",
"DisplaySourceRIC": false
}
}
Best Answer
-
The request message in the question is used to create a report template on the DSS server.
The 201 HTTP status indicates that the report template was created on the DSS server.
The response contains a ReportTemplateId and descriptions of the report template.
The created report template can be used with an instrument list to create a schedule extraction.
For more information on scheduling an immediate extraction, please refer to REST API Tutorial 12: GUI control calls: immediate extract.
Otherwise, you can use the on-demand extraction as mentioned by my colleague.
0
Answers
-
Hello @praveen.rangaiah0 ,
From my testing, submitting the request exactly as in the question, first, has resulted in Status = 400 (Bad Request).
The valid statuses are 200 (completed) and 202 (accepted for execution).
The request appears to have several issues, does not appear to have instruments included.
You may wish to try the following request as a working starting point, and can be tuned to your requirements:
{
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest",
"ContentFieldNames": [
"Quote - Ask Price",
"Quote - Ask Size"
],
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [{
"Identifier": "CARR.PA",
"IdentifierType": "Ric"
}]
},
"Condition": {
"MessageTimeStampIn": "GmtUtc",
"ApplyCorrectionsAndCancellations": true,
"ReportDateRangeType": "Relative",
"RelativeStartDaysAgo": 1,
"RelativeEndDaysAgo": 0,
"RelativeStartTime": "10:00:00.000",
"RelativeEndTime": "23:59:59.999",
"DateRangeTimeZone": "Local Exchange Time Zone",
"DisplaySourceRIC": false
}
} }I would like to suggest reviewing and working through a step-by-step tutorial on how to retrieve TickHistoryTimeAndSales data REST API Tutorial 4: On Demand tick data extraction
If you get status = 202 back, you can harvest ExtractionID from the response header and check the status of the job as shown in tutorial until status becomes 200 and the results are ready to be retrieved.
I hope this information helps.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛