I had an fql query in my code that up until last week (or thereabout) worked perfectly and then suddenly stopped working.
I’m now getting a bizarre #803 error along with the message “Some of the aliases you requested do not exist:” which is peculiar (and I believe to be a total red herring) since I have now tried removing ALL my previous aliases and replacing them with just “name”.
Totally at my rope’s end trying to figure out what Facebook changed over the last couple of weeks that would be causing this. If anyone has any insight I’d be really grateful to hear it.
I’m posting my code here, but am not expecting any commentary on the code itself seeing as how it worked perfectly for several months until some point within the last two weeks or so.
The specific intention of the code was to fetch an auth token for the user and then retrieve some more detailed information that isn’t available in the /me request.
//I call this first to get the token
function checkStatus() {
try{
FB.getLoginStatus( function( loginResponse ){
if( loginResponse.status == "connected" ){
authToken = loginResponse.authResponse.accessToken;//this comes back as expected
expiresIn = loginResponse.authResponse.expiresIn;//this comes back as expected
getUserInfo();
} else {
registerApp();//this gets called if the user hasn't approved the app yet... this continues to work as expected
}
} );
}
catch(e){
alert("ERROR" + e);
}
}
//so the above method calls this
function getUserInfo(){
FB.api( "/me", function( meResponse ){
meResponse.authToken = authToken;
meResponse.expiresIn = expiresIn;
console.log("meResponse = " + JSON.stringify(meResponse));
//this contains all the correct expected data
FB.api(escape("/fql&q=SELECT name FROM user WHERE uid = '"+ meResponse.id +"'"),//here I've eliminated ALL extra aliases (though none of them were a problem before
function( response ){
console.log("RESP = " + JSON.stringify(response)); //this comes back with the following error:
//{"error":{"message":"(#803) Some of the aliases you requested do not exist: fql&q=SELECT name FROM user WHERE uid = 'xxxxxxxxx'","type":"OAuthException","code":803}}
}
)
} );
}
So… it would appear that FB just totally altered the syntax for how fql is to be called, and I am not seeing ANY reference to the old way that I have above (which TOTALLY worked).
The new way is to pass in a JSON object that looks like this:
and the response NO LONGER comes back as an array called data, and is now a raw unnamed array at the top level of the returned object… so in my example above, I am now just looking at response[0] as opposed to response.data[0].
I see no mention of any of these changes in any of their documentation… maybe I’m just losing my mind, but it looks like they just totally up and modified their API with no warning.
Maybe I’m missing something (I usually am).
Just in case someone else needs help with this… here’s an example of the newly working code…