This is my query:
select uid, name, is_app_user from user where uid in (select uid2 from friend where uid1=me()) and is_app_user=1
and I need t
Execute query via FB.api
-
FB.api("/fql?q="+encodeURIComponent('{your-query}'), function(response) {
if (!response || response.error) {
console.log('Error occurred: '+response.error.message);
} else {
console.log(response);
}
});
You can run this via the FB.api() method of the JS SDK (https://developers.facebook.com/docs/javascript/reference/FB.api) by using the
/fql?q=
endpoint if you URL encode your query like this
/fql?q=select%20uid%2C%20name%2C%20is_app_user%20from%20user%20where%20uid%20in%20(select%20uid2%20from%20friend%20where%20uid1%3Dme())%20and%20is_app_user%3D1&access_token={YOUR_USER_ACCESS_TOKEN}
JS code would look like this for example:
FB.api('/fql?q=select%20uid%2C%20name%2C%20is_app_user%20from%20user%20where%20uid%20in%20(select%20uid2%20from%20friend%20where%20uid1%3Dme())%20and%20is_app_user%3D1&access_token={YOUR_USER_ACCESS_TOKEN}', function(response) {
console.log(response);
});
Don't forget to add your Access Token!