2

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.

4
  • Your syntax is correct for the SDK. I would suggest removing your conditional, and attempting the filter with some basic, hard coded values to better understand the issue. I don't think it's the SDK here. Commented Mar 9, 2014 at 18:14
  • I did use hard coded values, it causes the same thing. Commented Mar 10, 2014 at 17:04
  • What version of Ruby are you on? Commented Apr 18, 2014 at 11:45
  • Sounds similar to the issues that are seen when Savon 2.3+ is used, please confirm you are using 2.2.0 by adding the following to your code so it will output the version that is actually being used: p Gem.loaded_specs["savon"].version
    – Mac
    Commented Apr 18, 2014 at 15:58

0

You must log in to answer this question.

Browse other questions tagged .