question

Upvotes
Accepted
2 0 1 3

TimeAndSales request in Java API (Invalid transaction type error)

I'm trying to download TimeAndSales transaction data using the TRTH Java API. I've adapted the quick start template by setting the message type:

           MessageType[] types = {
                new MessageType("TimeAndSales", new ArrayOfString(fields))
            };

And I set the request type from intraday to the following:

request.setRequestType(RequestType.TimeAndSales);

But I'm getting the following error when I run the code:

Bad request --> Invalid transaction type TimeAndSales for RequestType.TimeAndSales

I viewed the messageType.java and the requestType.java and can't seem to see any indication of the types of transaction messages I should be setting to get Time and Sales to work.

Any help is greatly appreciated. Thank you.

tick-history-rest-apiapijava
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.

1 Answer

Upvote
Accepted
56k 145 45 65

@raust

You need to use GetMessageTypes function to find the available message types for RequestType.TimeAndSales. TimeAndSales is not a valid message type for RequestType.TimeAndSales.

The available message types for RequestType.TimeAndSales are:

  • Trade
  • Index
  • Equities
  • Warrants
  • Money Market
  • Reference Change
  • Settlement Price
  • Open Interest
  • Auction
  • Order Imbalance
  • Futures
  • Short Sale
  • Miscellaneous
  • C&E Quote
  • Quote
  • FI Quote
  • Convertibles Transactions
  • Mkt. Statistic
  • Mutual and Money Market Funds
  • Mkt. Condition
  • Options on Futures
  • Correction
  • Raw
  • Indices and Market Statistics
  • Symbology Change
  • Equity Options
  • Economic Indicator
  • Fund Stats
  • OTC Quote
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.

Thank you for your help.