Closed mailbaoer closed 6 years ago
You can use filtering like below.
filtering = [<FILTER_1>, <FILTER_2>, ...].to_json
ad_account.campaigns(filtering: filtering).all
=> [#<FacebookAds::Campaign {:id=> <CAMPAIGN_ID>}>, ...]
🌹 thank you very much, that works! @ssankim
I ran into this error as well!
I think it would be more intuitive for the library to accept an array instead of / in addition to JSON, or to check if the filtering object is JSON and raise a more descriptive error ("Receivd class Array, xpected JSON formatted string" or similar) if it isn't.
When I use filtering to find out some campaigns with ids, it said that
The parameter filtering[0][operator] is required
, but I confirm I have the operator params,the code is below:how can I use the filtering correctly? Thank you very much!