how do I query a inactive RIC int Tickhistory V2
HI
I try to build some Java code to schedule a task to question some inactive RIC but it looks dow not work I got bad request error. this is my java code, any help?
protected JSONArray getRICJsonArray(List<String> ric) {
JSONArray ricList = new JSONArray();
ric.forEach(e ->
ricList.put(new JSONObject()
.put("@odata.type", "#ThomsonReuters.Dss.Api.Search.HistorcalSearchResult")
.put("Description", "Historical Instrument")
.put("Identifier", e)
.put("IdentifierType", "Ric")
.put("FirstDate", "2006-01-01T00:00:00.000Z")
.put("LastDate", LocalDate.now().toString() + "T23:59:59.000Z")
));
return ricList;
}
@{"Identifiers":[{"LastDate":"2017-05-26T23:59:59.000Z","Description":"Historical Instrument","Identifier":"PETM.OQ","@odata.type":"#ThomsonReuters.Dss.Api.Search.HistorcalSearchResult","FirstDate":"2006-01-01T00:00:00.000Z","IdentifierType":"Ric"}],"KeepDuplicates":true}
if I replace JSONObject to JSONOrderObject I got
@{"Identifiers":["{\"@odata.type\":\"#ThomsonReuters.Dss.Api.Search.HistorcalSearchResult\",\"Description\":\"Historical Instrument\",\"Identifier\":\"PETM.OQ\",\"IdentifierType\":\"Ric\",\"FirstDate\":\"2006-01-01T00:00:00.000Z\",\"LastDate\":\"2017-05-26T23:59:59.000Z\"}"],"KeepDuplicates":true}
Both doesnot work any Idea?
Best Answer
-
Hi @bin
In Java, you may find the following code excerpt helpful
HttpPost httppost = new HttpPost(urlHost + "/Search/HistoricalSearch");
httppost.addHeader("content-type", "application/json;odata.metadata=minimal");
httppost.addHeader("Authorization", "Token "+sessionToken);
JSONOrderedObject searchJSONObject = new JSONOrderedObject()
.put("Request", new JSONOrderedObject()
.put("Identifier", "PETM.OQ")
.put("IdentifierType", "Ric")
.put ("Range", new JSONOrderedObject()
.put("Start", "2000-09-29T00:00:00.000Z")
.put("End", "2017-09-29T00:00:00.000Z"))
);it produces the following result for me:
JSON response: {"@odata.context":"https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.HistoricalSearchResult)",
"value":[{
"Status":"Valid",
"LastDate":"2015-03-14T00:00:00.000Z",
"Identifier":"PETM.OQ",
"Description":"Historical Instrument",
"DomainCode":"6",
"FirstDate":"2002-07-20T00:00:00.000Z",
"InstrumentType":"Unknown",
"History":[],"IdentifierType":"Ric","Source":"","Key":"...}]}0
Answers
-
I change the code and now request to following code.
@{"Identifiers":[{"@odata.type":"#ThomsonReuters.Dss.Api.Search.HistorcalSearchResult","Description":"Historical Instrument","Identifier":"PETM.OQ","IdentifierType":"Ric","FirstDate":"2006-01-01T00:00:00.000Z","LastDate":"2017-05-26T23:59:59.000Z"}],"KeepDuplicates":true}
I still got bad request?
0 -
There a type error. I changed but still cannot find the RIC??
Request
@{"@odata.context":"https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#InstrumentLists/$entity","ListId":"0x05bb9efdbc6b3036","Name":"test1Name_TInstrumentslist","Count":0,"Created":"2017-05-26T17:45:28.262Z","Modified":"2017-05-26T17:45:28.262Z"
Response
@{"@odata.context":"https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.SubjectLists.InstrumentsAppendIdentifiersResult","ValidationResult":{"ValidInstrumentCount":0,"OpenAccessSegments":[],"StandardSegments":[],"ValidationDuplicates":[],"Messages":[{"Severity":"Info","Message":"RIC,
PETM.OQ (not
found)"}]},"AppendResult":{"AppendedInstrumentCount":0,"AppendDuplicates":[]}}0 -
Hi @bin,
I think you are looking to validate expired RICs
If yes, please refer to this answer
If you like to run HistoricSearch, I think you need HistoricalSearch, not HistoricSearchResult and date Range, for Search/HistoricalSerach description please refer to
0 -
This query is a duplicate of this query which has an answer.
0 -
@bin,
Perhaps you can try Search/HistoricalSearch
{
"Request": {
"Identifier": "PETM.OQ",
"IdentifierType": "Ric",
"Range": {
"Start": "1996-01-01T00:00:00.000Z",
"End": "2017-02-28T00:00:00.000Z"
}
}
}that results in:
{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.HistoricalSearchResult)",
"value": [
{
"Identifier": "PETM.OQ",
"IdentifierType": "Ric",
"Source": "",
"Key": "...",
"Description": "Historical Instrument",
"InstrumentType": "Unknown",
"Status": "Valid",
"DomainCode": "6",
"FirstDate": "2002-07-20T00:00:00.000Z",
"LastDate": "2015-03-14T00:00:00.000Z",
"History": []
}
]
}0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 167 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 705 Datastream
- 1.5K DSS
- 633 Eikon COM
- 5.2K Eikon Data APIs
- 14 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 6 Trading API
- 3K Elektron
- 1.5K EMA
- 259 ETA
- 569 WebSocket API
- 40 FX Venues
- 16 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 4 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 284 Open PermID
- 47 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 24 RDMS
- 2.2K Refinitiv Data Platform
- 879 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 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
- 123 Open DACS
- 1.1K RFA
- 108 UPA
- 196 TREP Infrastructure
- 232 TRKD
- 919 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 103 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛