views:

847

answers:

1

I'm playing around with the Facebook API's fql.multiQuery method. I'm just using the API Test Console, and trying to get a successful response but can't seem to figure out exactly what it wants.

Here's the text I'm entering into the "queries" field:

{"tags" : "select subject
from photo_tag
where subject != 601599551
and pid in (
 select pid
 from photo_tag
 where subject = 601599551
)
and subject in (
 select uid2
 from friend
 where uid1 = 601599551
)",
"foo" : "select uid from user where uid = 601599551"}

All it'll give me is a queries parameter: array expected. error.

I've also tried just about every permutation I could think of involving wrapping the name/query pairs in their own curly braces, adding brackets, adding whitespace, removing whitespace in case it didn't want an associative array (for those watching the edits, I just found out about these wonderful things now... oy), all to no avail. Is there something painfully obvious I'm missing here, or do I need to make like Chuck Norris Jon Skeet and simply will it to do my bidding?


Update: A note to anyone finding this question now: The fql.multiquery test console appears to be broken. You can test your query by clicking on the generated url in the test console and manually adding the "queries" parameter into the querystring.

+1  A: 

Apparently I wasn't too far from the truth with the Jon Skeet comment... It seems the test console is VERY particular about what whitespace you can use where:

http://bugs.developers.facebook.com/show%5Fbug.cgi?id=6403

This is what I ended up having to do with my code:

{"tags":"select subject from photo_tag where subject != 601599551 and pid in (select pid from photo_tag where subject = 601599551 ) and subject in (select uid2 from friend where uid1 = 601599551 )","foo":"select uid from user where uid = 601599551"}

Awesome. Because that's readable.

Daniel Schaffer
+1 LOL @ that's readable.
Dustin Fineout

related questions