question

Upvotes
Accepted
0 0 1 3

TRTH Historical Criteria search

I am trying to retrieve all stocks associated with Shanghai exchange using the historical criteria call for TRTH. The exchange code for Shanghai is SHH, when I put this into a call such as:

POST: https://hosted.datascopeapi.reuters.com/RestApi/v1/Search/HistoricalCriteriaSearch

{
  "Request": {
    "RicPattern": null,
    "BondTypeCodes": null,
    "ContributorIds": null,
    "CountryCodes": null,
    "CurrencyCodes": null,
    "ExchangeCodes": "SHH",
    "FutureMonthCodes": null,
    "InstrumentTypeCodes": null,
    "OptionMonthCodes": null,
    "OptionTypeCodes": null,
    "CouponRate": null,
    "StrikePrice": null,
    "ExpiryDate": null,
    "MaturityDate": null,
    "Range": {
      "Start": "2019-12-16T00:00:00.000Z",
      "End": "2019-12-17T00:00:00.000Z"
    }
  }
}

I get the following error:

{
"error": {
"message": "Malformed request payload: Invalid cast exception for property ExchangeCodes: Unable to cast object of type 'System.String' to type 'System.Collections.Generic.List`1[System.String]'."
}
}

CAn you confirm if I'm doing something wrong?

tick-history-rest-apirest-api
icon clock
10 |1500

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

Upvote
Accepted
11.3k 25 8 14

Hi @jack.coppinger1,

The type of ExchangeCodes is a list of string. You need to add brackets between "SHH". However, the "SHH" likely doesn't work. According to API Reference Tree, You need to use "144" instead.


Below is the sample.

"ExchangeCodes": ["144"],

1576757196707.png (36.0 KiB)
icon clock
10 |1500

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

Upvotes
0 0 1 3
Many thanks Veerapath, this now seems to be working as anticipated. Thanks for your help.
icon clock
10 |1500

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