question

samara avatar image
76 5 3 7

Search multiple RICS

I am trying to search multiple Instruments using the example given by Reuters.they have given example of three instruments if i mention 4 RICS and % RICS it is giving bad request.can someone explain how this works?

Reuters given the below code and iit is working with 4 RICS

put("Identifier", "US10YT=RRPS,JPY=,IBM.N, INVALID.RIC")

if i give the identifier string length bigeer than the above it is giving bad request error.can someone let me know how the alter the string length here

below is the code used to serch the RICS

public void searchByRICRequest() { try { HttpPost httppost = new HttpPost(urlHost + "/Search/InstrumentSearch"); httppost.addHeader("content-type", "application/json;odata.metadata=minimal"); httppost.addHeader("Authorization", "Token " + sessionToken); JSONObject searchJSONObject = new JSONObject() .put("SearchRequest", new JSONObject() .put("IdentifierType", "Ric") //.put("Identifier", "US10YT=RRPS") .put("Identifier", "US10YT=RRPS,JPY=,IBM.N, INVALID.RIC") .put("InstrumentTypeGroups", new JSONArray() .put("CollatetizedMortgageObligations") .put("Equities") .put("FuturesAndOptions") .put("GovCorp") .put("MortgageBackedSecurities") .put("Money") .put("Municipals") .put("Funds")) .put("PreferredIdentifierType", "Ric"));

tick-history-rest-apisearch
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

veerapath.rungruengrayubkul avatar image
11.3k 25 8 13

@samara

I have tried the code with more instrument added and received a Bad Request error. Once I use the same request message in Postman, the response's body contains the following error. This should be the limitation of the identifier length. You may need to separate the Search request if the length exceed 50 characters.

{
    "error": {
        "message": "Validation Error:\r\n\r\nIdentifier can not exceed 50 characters"
    }
}
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

satish.shioshankar.gaidhane avatar image

Anyone got answer to this? we are struggling on how to search multiple RICs

10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.