I've tried using both the JavaScript and PHP SDKs, but I can't solve this simple problem.
My FQL looks like:
SELECT count FROM comments_info WHERE xid="..."
When I attempt the request through PHP, I get the following error:
Uncaught Exception: 604: No valid app_id
PHP:
$facebook = new Facebook(array(
'appId' => '...',
'secret' => '...',
'cookie' => true
));
$result = $facebook->api(array(
'method' => 'fql.query',
'query' => 'SELECT count FROM comments_info WHERE xid="'.[...].'"'
));
The appId
and secret
I copied from the application page in the Facebook Developer app.
Similarly, when I use the JS API, as in:
var query = FB.Data.query('SELECT count FROM comments_info WHERE xid="' + [...] + '"');
query.wait(function(rows){});
... I get the same error in the JSONP response:
FB.ApiServer._callbacks.f2ba554518({"error_code":"604","error_msg":"No valid app_id","request_args":[{"key":"access_token","value":"[MY APP ID]|[THE ACTUAL ACCESS TOKEN]"},{"key":"api_key","value":"[MY APP ID, AGAIN]"},{"key":"callback","value":"FB.ApiServer._callbacks.f2ba554518"},{"key":"format","value":"json-strings"},{"key":"method","value":"fql.multiquery"},{"key":"queries","value":"{\"index_comments_info_xid\":\"select xid,count from comments_info where xid=\\\"[...]\\\"\"}"},{"key":"sdk","value":"joey"}]});
I even tried recreating the application several times.
At this point, I've invested more hours than I'd care to admit :) So, if anyone has experience with this problem, I'd be very appreciative — Facebook's documentation is no help at all, and their dev forums are pretty much dead.