TRTHv2 REST API

screenshot-from-rest-api-user-guide-45-46.pdf
Case : 05603568
Hi Team,
Client is unable to run a tick data query using the new REST
API . Getting an error when trying to replicate page 46 of the REST API user
manual.
------------------------------------------------------------
POST
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractRaw
Authorization: Token
Content-Type:
application/json
Prefer:
respond-async
{"ExtractionRequest":
{"Condition": {"ReportDateRangeType": "Range",
"MessageTimeStampIn": "GmtUtc",
"ApplyCorrectionsAndCancellations": true, "ExtractBy":
"Entity", "QueryEndDate":
"2017-06-15T00:00:00.000Z", "DisplaySourceRIC": true,
"Preview": "Content", "QueryStartDate":
"2017-06-16T00:00:00.000Z"}, "IdentifierList":
{"UseUserPreferencesForValidationOptions": false,
"ValidationOptions": null, "@odata.type":
"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [{"Identifier": "CCU7",
"IdentifierType": "Ric"}]}, "@odata.type":
"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest",
"ContentFieldNames": ["THT.Quote - Ask Price",
"THT.Quote - Ask Size", "THT.Quote - Bid Size",
"THT.Quote - Bid Size"]}}
{'error':
{'message': 'Malformed request payload: For the property name
"ReportDateRangeType" in the JSON request the value could not be
parsed successfully. Please check the casing or spelling of the property.'}}
'{"error":{"message":"Malformed
request payload: Syntax error at Line 1, Char 71: Invalid array element type
for property \'ContentFieldNames\'. Expected element type of
\'ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionRequestBase\',
but found \'System.String\'. {\\"ExtractionRequest\\":
{\\"ContentFieldNames\\": [\\"Auction - Exchange Tim"}}'
It looks like the JSON parser is not correctly converting datatypes.
------------------------------------------------------------
Best Answer
-
There are several issues in that request:
- The extraction request data type must be the first element of the content.
- The identifier list should not be inside the conditions
- Content field names should use the Name, not the Code, i.e. they should use "Quote - Bid Size", not "THT.Quote - Bid Size"
- There is a duplicate field name.
- The query start date is after the end date.
This one will work:
{
"ExtractionRequest": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest",
"ContentFieldNames": [
"Quote - Ask Price", "Quote - Ask Size", "Quote - Bid Price", "Quote - Bid Size"
],
"IdentifierList": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [{
"Identifier": "CCU7",
"IdentifierType": "Ric"
}],
"ValidationOptions": null,
"UseUserPreferencesForValidationOptions": false
},
"Condition": {
"MessageTimeStampIn": "GmtUtc",
"ApplyCorrectionsAndCancellations": true,
"ReportDateRangeType": "Range",
"QueryStartDate": "2017-06-15T00:00:00.000Z",
"QueryEndDate": "2017-06-16T00:00:00.000Z",
"ExtractBy": "Entity",
"Preview": "Content",
"DisplaySourceRIC": true
}
}
}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
- 687 Datastream
- 1.4K DSS
- 621 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 4 Trading API
- 2.9K Elektron
- 1.4K EMA
- 254 ETA
- 557 WebSocket API
- 38 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
- 276 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
- 669 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 229 TRKD
- 917 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
- 48 中文论坛