question

Upvotes
Accepted
69 11 20 19

HistoricalCriteriaSearch - More detailed example

Hi, we currently try to make a HistoricalCriteriaSearch request. Looks like we are doing something wrong and we have the feeling that there are 'hidden' dependencies regarding the available search fields. We are performing the following request:

{ "Request": { "RicPattern": "^DTEGn", "CurrencyCodes": [ "EUR" ], "OptionMonthCodes": ["X" ], "Range": { "Start": "2016-11-07T00:00:00.000Z", "End": "2017-11-08T00:00:00.000Z" } } }

And we get this response:

{ "error": { "message": "Gateway ETH returned error status code: BadRequest from (http://rp.cp.hdc.reuint.com/TickHistoryWS/search) Error ID: [29427a15-c7e9-4079-9183-216ee22f14c2]" } }

Can you please advice? We need this search request to lookup expired options and futures, and we really rely on this...

Thx in advance!

dss-rest-apitick-history-rest-apihistorical
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.

@Philipp, considering your query, we moved it from the DSS to the TRTH forum, it seems more appropriate (HistoricalCriteriaSearch is an API call for TRTH customers), and will help people discover it. AHS

1 Answer

· Write an Answer
Upvotes
Accepted
13.7k 26 8 12

@Philipp

The REST API Reference tree description of the parameters of the HistoricalCriteriaSearch call shows that for this API call currency codes must be encoded using the ISO-4217 code number, not the text. Instead of EUR, use 978. This request will deliver data instead of an error:

{ "Request": { "RicPattern": "^DTEGn", "CurrencyCodes": [ "978" ], "OptionMonthCodes": ["X" ], "Range": { "Start": "2016-11-07T00:00:00.000Z", "End": "2017-11-08T00:00:00.000Z" } } }
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.

Thx a lot!

Comment by Rick Weyrauch (reposted to limit visibility):

I have been reviewing this today as well from a "what are we doing about the undesirable outcome when a user uses the wrong code" standpoint. What I concluded: We really are not very clear in the HistoricalCriteriaSearch help that it requires a code from GetHistoricalCurrencies (which are all numerical strings), and not a code from GetCurrencies, which are used in all non-historical calls.

I think a case can be made that these two list get better documented and possibly even consolidated. I will ask a few people about that tomorrow.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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