Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameter filtering[0][operator] is required #53

Closed
mailbaoer opened this issue Aug 9, 2018 · 3 comments
Closed

The parameter filtering[0][operator] is required #53

mailbaoer opened this issue Aug 9, 2018 · 3 comments

Comments

@mailbaoer
Copy link

mailbaoer commented Aug 9, 2018

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:

ad_account.campaigns(filtering: [{"field":"id","operator":"EQUAL", "value":"23842979460490127"}]).all

how can I use the filtering correctly? Thank you very much!

@ssankim
Copy link

ssankim commented Aug 10, 2018

You can use filtering like below.

filtering = [<FILTER_1>, <FILTER_2>, ...].to_json
ad_account.campaigns(filtering: filtering).all

=> [#<FacebookAds::Campaign {:id=> <CAMPAIGN_ID>}>, ...]

@mailbaoer
Copy link
Author

🌹 thank you very much, that works! @ssankim

@tmbv93
Copy link

tmbv93 commented May 16, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants