mikecmpbll / betfair

Ruby library for the Betfair Exchange API.
MIT License
17 stars 20 forks source link

list_market_book(market_id), client returns {"detail"=>{}, "faultcode"=>"Client", "faultstring"=>"DSC-0008"} #3

Closed rudedoc closed 9 years ago

rudedoc commented 9 years ago

Just checking out the gem. Using the example code I tried:

racing_markets.each do |market|
  client.list_market_book(market['marketId'])
end

it returns: {"detail"=>{}, "faultcode"=>"Client", "faultstring"=>"DSC-0008"}

mikecmpbll commented 9 years ago

As per the listMarketBook documentation, you are required to supply a "marketIds" parameter. And you can list multiple markets in one call so no point looping and causing more noise on the API:

client.list_market_book(marketIds: racing_markets.map{ |m| m['marketId'] })
rudedoc commented 9 years ago

Correct!

Thanks for that and the great little gem!