question

Upvotes
Accepted
5 3 6 8

verifyRICS (SOAP) implementation on REST API (TRTHv2)

Hi,

We are migrating from SOAP API to REST API (TRTHv2) and we'd like to know how to get the same functionality of the verifyRICs method (SOAP) on the new REST API:

import com.thomsonreuters.tickhistory.webservice.TRTHApi;

...

private TRTHApi api;

...

VerifyRICsResult result =  api.verifyRICs(range, new ArrayOfInstrument(instrumentList), true);

Thanks in advance

tick-history-rest-apidss-soap-api
icon clock
10 |1500

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

Upvotes
Accepted
13.7k 26 8 12

@esrism, as far as I know there is no equivalent API call, but there are different possibilities for verifying RICs:

1) To verify the current validity of a RIC, you can search for it, using a POST to endpoint Search/InstrumentSearch.

Body:

{
  "SearchRequest": {
    "IdentifierType": "Ric",
    "Identifier": "CARR.PA",
    "PreferredIdentifierType": "Ric"
  }
}

If the instrument is currently valid you will receive something like:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Content.ValidatedInstrument)",
    "value": [
        {
            "Identifier": "CARR.PA",
            "IdentifierType": "Ric",
            "Source": "PAR",
            "Key": "VjF8MHgwMDAzZGQwMDE0Yjg0ZTNjfDB4MDAwM2RjMDA0YzFjYWYyMHxQQVJ8RVFRVXxFUVRZfE9EU0h8RXx8Q0FSUi5QQXwwMDUy",
            "Description": "CARREFOUR ORD",
            "InstrumentType": "EquityQuote",
            "Status": "Valid"
        }
    ]
}

If it is invalid, the returned field value will be empty. More on this call in REST API Tutorial 16.

2) To verify the historical validity of a RIC, you can use endpoint Search/HistoricalSearch.

Body (contains the date range where you want to check validity):

{
  "Request": {
    "Identifier": "CARR.PA",
    "IdentifierType": "Ric",
    "Range": {
      "Start": "2017-01-01T00:00:00.000Z",
      "End": "2017-01-01T00:00:00.000Z"
    }
  }
}

More on historical search in REST API Tutorial 13.

3) If you append instruments to an instrument list, the response will tell you how many are valid, and deliver error messages for those that are not, like:

"Messages": [
    {
        "Severity": "Info",
        "Message": "RIC, @@@ (not found)"
    }
]

More on this in REST API Tutorial 12.

Edit: added possibility:

4) Perform a validation on a set of instruments, using endpoint Extractions/InstrumentListValidateIdentifiers.

Body (only the first instrument is valid in this example):

{
  "InputsForValidation": [
    {
      "Identifier": "191216100",
      "IdentifierType": "Cusip"
    },{
      "Identifier": "JUNK.RIC",
      "IdentifierType": "Ric"
    },{
      "Identifier": "INVALID",
      "IdentifierType": "Ric"
    }
  ],
  "KeepDuplicates": false
}

Result:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.SubjectLists.InstrumentsValidateIdentifiersResult",
    "ValidatedInstruments": [
        {
            "Identifier": "191216100",
            "IdentifierType": "Cusip",
            "Source": "NYS",
            "Key": "VjF8MHgwMDAzZGQwMDE0ZjkxODJifDB4MDAwM2RjMDA0YTA0NjlmOHxOWVN8RVFRVXxFUVRZfE9EU0h8RXx8S08uTnwwMDc3",
            "Description": "COCA-COLA ORD",
            "InstrumentType": "EquityQuote",
            "Status": "Valid"
        }
    ],
    "ValidationResult": {
        "ValidInstrumentCount": 1,
        "OpenAccessSegments": [],
        "StandardSegments": [
            {
                "Code": "E",
                "Description": "Equity",
                "Count": 1
            }
        ],
        "ValidationDuplicates": [],
        "Messages": [
            {
                "Severity": "Info",
                "Message": "RIC, JUNK.RIC (not found)"
            },
            {
                "Severity": "Info",
                "Message": "RIC, INVALID (not found)"
            }
        ]
    }
}

Hope this helps

icon clock
10 |1500

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

Upvotes
5 3 6 8

Thank you, @Christiaan Meihsl for the alternatives (REST-oriented) to verifyRICs (SOAP-oriented) provided to us.

Focusing on the first one, we identified some requirements that are not currently met. Let me share the most important one with all of you:

The most important requirement, and having in mind what api.veriyRICs does, the currency code of each instrument should be returned in the response, which does not correctly occurs:


{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Content.ValidatedInstrument)",
    "value": [
        {
            "Identifier": "IBM.N",
            "IdentifierType": "Ric",
            "Source": "NYS",
            "Key": "VjF8MHgwMDAzZGQwMDEzNzlkNDYwfDB4MDAwM2RjMDA0YTAyNGZkOHxOWVN8RVFRVXxFUVRZfE9EU0h8RXx8SUJNLk58MDA3Nw",
            "Description": "INTERNATIONAL BUSINESS MACHINES ORD",
            "InstrumentType": "EquityQuote",
            "Status": "Valid"
        },
        {
            "Identifier": "SAN.MC",
            "IdentifierType": "Ric",
            "Source": "MCE",
            "Key": "VjF8MHgwMDAzZGQwMDEzNzlmZjRifDB4MDAwM2RjMDA0ODI5Mzk4N3xNQ0V8RVFRVXxFUVRZfE9EU0h8RXx8U0FOLk1DfDAxMDE",
            "Description": "BANCO SANTANDER ORD",
            "InstrumentType": "EquityQuote",
            "Status": "Valid"
        },
        {
            "Identifier": "JPY=",
            "IdentifierType": "Ric",
            "Source": "RCT",
            "Key": "VjF8MHgwMDEwMGIwMDAzMGE5MDEyfDB4MDAwM2RjMDAzNDcyZjc2ZXxSQ1R8TU5RVXxNT05ZfE1PTll8WXx8SlBZPXwwMTQz",
            "Description": "US Dollar/Japanese Yen FX Spot Rate",
            "InstrumentType": "MoneyMarketQuote",
            "Status": "Valid"
        },
        {
            "Identifier": "US10YT=RRPS",
            "IdentifierType": "Ric",
            "Source": "EJV",
            "Key": "VjF8MHgwMDEwMmMyNmZlYzUwZTJmfDB4MDAxMDJjZDdiY2U1MGViY3xFSlZ8R0NCRHxHT1ZUfEdCTkR8R3xOfFVTMTBZVD1SUlBTfEdPUlA",
            "Description": "UST    2.250 08/15/27",
            "InstrumentType": "GovCorpBond",
            "Status": "Valid"
        }
    ]
}

The shown above is the result of calling the /Search/InstrumentSearch resource with the following JSON body:

{
  "SearchRequest": {
    "InstrumentTypeGroups": [
      "CollatetizedMortgageObligations",
      "Commodities",
      "Equities",
      "FuturesAndOptions",
      "GovCorp",
      "MortgageBackedSecurities",
      "Money",
      "Municipals",
      "Funds"
    ],
    "IdentifierType": "Ric",
    "Identifier": "US10YT=RRPS,JPY=,IBM.N, INVALID.RIC, SAN.MC",
    "PreferredIdentifierType": "Ric"
  }
}<br>

The next screenshot shows, from the API reference tree, the complete structure of the response message, where a CurrencyCode field is present

Is there a way of getting the missing currency code?

Thanks, in advance, for your help.


icon clock
10 |1500

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

@ricardo.siguero, I'm sorry, it is not possible, the returned field list is not configurable, and all those available are those you received. The API Reference Tree is incorrect.

Upvotes
5 3 6 8

Hi,

As an addition to my previous post from today, just share with you that we also need to specify a date range to be used in the RICs validation.

For that reason, we took a look at the second alternative @Christiaan Meihsl provide us (the

Search/HistoricalSearch resource).

{
  "Request": {
    "Identifier": "AAPL.OQ",
    "IdentifierType": "Ric",
    "Range": {
      "Start": "2017-08-24T00:00:00.000Z",
      "End": "2017-08-24T23:59:59.000Z"
    }
  }
}

Unfortunately, the data returned by the response didn't contain the currency code for every instrument identifier:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.HistoricalSearchResult)",
    "value": [
        {
            "Identifier": "AAPL.OQ",
            "IdentifierType": "Ric",
            "Source": "",
            "Key": "VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxBQVBMLk9RfA",
            "Description": "Historical Instrument",
            "InstrumentType": "Unknown",
            "Status": "Valid",
            "DomainCode": "6",
            "FirstDate": "2002-07-20T00:00:00.000Z",
            "LastDate": "2017-08-30T00:00:00.000Z",
            "History": []
        }
    ]
}

The HistoricalSearchResult data structure does not contain such attribute (as seen on it's related entry on the API's reference), so the only approach to be followed (unless a more efficient one was raised) would be:

  1. Using Search/HistoricalSearch forverifying the whole of instrument identifier, then
  2. Iterate over the valid identifiers' list and, for every id, invoke to a different API resource (that we don't know at the time of writing this post) that can provide us its related currency code at a given date.

Thanks, in advance, for all your feedback and help.

icon clock
10 |1500

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

@ricardo.siguero, to retrieve the currency code at a given date, you can use a Historical Reference Extraction. This is described in REST API Tutorial 10.

Thank you, @Christiaan Meihsl , for your help.

Upvotes
1 0 0 0

We also need to specify a date range to be used in validating RICs, however we need to validate a large number of RICs (a few thousand) over a common date range in the most efficient way. What would be the proposed way we do this?

Method 2) above is the closest match to our requirement, however it would mean thousands of calls to Search/HistoricalSearch which doesn't feel very efficient.

icon clock
10 |1500

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

@richard.sharrock, a date range implies you want to do a historical search, i.e. use method 2) above, which is only possible 1 instrument at a time. The call returns a result fairly quickly (with Postman on my PC I observe a mean time slightly less than 1 sec/call). Depending on how much your instrument list and date range vary from day to day, you might want to investigate caching some results from day to day, to optimize performance.

Method 4) above can validate multiple RICs, but will not take a date range.

I do not see other possibilities.

Click below to post an Idea Post Idea