koala icon indicating copy to clipboard operation
koala copied to clipboard

Cannot use filtering parameters and cannot log request for debugging

Open AlexCppns opened this issue 8 years ago • 5 comments

Hi there, I am having trouble with request parameters, especially filtering arrays... I also cannot find any way to log the actual request to facebook servers.

The code:

client.get_connections("act_XXXXXXXXX/customaudiences?filtering[0][value]=Client&filtering[0][operator]=CONTAIN&filtering[0][field]=name")

The error:

Koala::Facebook::ClientError: type: OAuthException, code: 100, message: (#100) The parameter filtering[0][operator] is required [HTTP 400]

This works perfectly fine in the graph api explorer...

AlexCppns avatar Sep 21 '16 19:09 AlexCppns

I think it crashes specifically on the word operator, is that a reserved word or so?

AlexCppns avatar Sep 21 '16 20:09 AlexCppns

I checked with a simple RestClient, the request works fine.

AlexCppns avatar Sep 21 '16 20:09 AlexCppns

Thanks for the issue! Apologies for the late response. I appreciate your reproducing it in the Graph API explorer.

I'm guessing it might be an encoding issue — I'll try testing it with the logger level set to debug and see what's produced and compare that to the explorer and fix it. (If you have a chance to test that, that would be awesome.)

arsduo avatar Feb 20 '17 01:02 arsduo

@AlexCppns Try this instead

client.get_connections("act_XXXXXXXXX",'customaudiences', { :filtering => [{ :field => 'name', :operator => 'CONTAIN', :value => 'Client' }].to_json })

Let me know if this works.

And for request logging try this -

Koala::Utils.level = Logger::DEBUG

agnel-waghela avatar Jul 27 '17 10:07 agnel-waghela

@AlexCppns Try this instead

client.get_connections("act_XXXXXXXXX",'customaudiences', { :filtering => [{ :field => 'name', :operator => 'CONTAIN', :value => 'Client' }].to_json })

Let me know if this works.

And for request logging try this -

Koala::Utils.level = Logger::DEBUG

@agnel-waghela It works perfectly.

maahesmahesh avatar Aug 13 '19 12:08 maahesmahesh