I'm trying to start using the Fuel SDK in Rails, but I can't seem to get a simple filter to work. Retrieving without a filter works fine, and returns the whole set (all 36 or whatever lists). I need to be able to retrieve individual lists (and subscribers to those lists is my next step once I figure out why these filters aren't working... any attempt to filter subscribers is returning "Message: Error: Object reference not set to an instance of an object.", though again it works without filters).
The example I'm trying to write is:
list = FuelSDK::List.new
list.client = @myclient
if list_id > 0
puts "Getting details for list #{list_id}"
list.filter = {'Property' => 'ID','SimpleOperator' => 'equals','Value' => list_id}
elsif not list_name.blank?
puts "Getting details for list #{list_name}"
list.filter = {'Property' => 'ListName','SimpleOperator' => 'equals','Value' => list_name}
end
getResponse = list.get
No matter what filter I try to use, I always get "Message: Error: Incorrect syntax near 'AND'.". As there is only one filter (note that's if/elsif above, and can't be both), there is no "AND" involved.