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
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 33 Data Model Discovery
- 682 Datastream
- 1.4K DSS
- 613 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
- 248 ETA
- 552 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
- 2 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.8K Refinitiv Data Platform
- 622 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
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 83 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛