views:

5277

answers:

4

Im looking without any success away to execute fql query with the new Graph api does any body knows how can i do this?

found the Answer in this excellent example : http://code.google.com/p/facebook-cpp-graph-api/

+1  A: 

http://developers.facebook.com/docs/reference/fql

tamir
man sure i saw this , and tryed to excute it and it dosn't work im keep getting this error<error_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <error_code>104</error_code> <error_msg>Requires valid signature</error_msg> <request_args list="true"> <arg> <key>method</key> <value>fql.query</value> </arg> <arg> <key>cancel</key> <value>url</value> </arg> <arg> <key>query</key> <value>SELECT recipient_id,notification_id, sender_id,
+5  A: 

https://api.facebook.com/method/fql.query?access_token=...&amp;query=SELECT%20hometown_location%20from%20user%20where%20uid%20in%20%28SELECT%20uid2%20from%20friend%20where%20uid1=1285036001%29

Also take a look at the performance guide in the FB documentation.

Neo302
you are right , in the documentation there is no info about adding the access_token ..this is why it didn't worked ...now its working but the result im getting are in gibberish something like this:<group> <name>x?x?x▌x?x? x?x?x?x¢x?x?x� x?x? "x☼x?x� x?x?x?x?x?" x?"x?x?x? x?x?x?xªx?" x?x?x?x"x?xªx?x?x?</name></group><group>
Try a simple query first and just paste the URL in the browser. You may have to save the results as my browser asked me to when I request JSON. You can open the returned file with notepad. Also add the parameter format=json if you want JSON instead of XML. Finally URLEncode your query. I noticed escapes are used in the JSON and its surrounded with [] which I needed to remove.
Neo302
check this out its has the answers http://code.google.com/p/facebook-cpp-graph-api/
+2  A: 

$data = $facebook->api( array( 'method' => 'fql.query', 'query' => 'SELECT shit FROM table...' ) );

Ilya Vassilevsky
is FQL supported by the new Graph API? By Support, I don't mean deprecated support.
Evans
that is the only method I found so far
Ilya Vassilevsky
+8  A: 

Here's an example of how to do a FQL query using the Graph API and JavaScript

FB.api(
        {
            method: 'fql.query',
            query: 'SELECT uid, first_name, last_name FROM user WHERE uid = ' + someUid
        },
        function(data) {
            //    do something with the response
        }
);

This assumes you've already setup your page according to the Facebook guidelines as shown here - http://developers.facebook.com/docs/reference/javascript/

marshall

related questions