I am trying to use the Facebook Query Language (FQL) to get a list of friends, who have installed my app. After authenticating my app and getting my app access token, I am executing the following query (note I am using Java and RestFB to run):
https://api-read.facebook.com/method/fql.query?query=SELECT+uid+FROM+user+WHERE+uid+IN+%28SELECT+uid2+FROM+friend+WHERE+uid1%3D<userId>%29+AND+is_app_user%3D1&access_token=<appAccessToken>&format=json
this returns an error:
..."error_code":102,"error_msg":"Requires user session"
Similarly if I try using FQL with the graph API (like below) I get the same error.
https://graph.facebook.com/fql?q=SELECT+uid+FROM+user+WHERE+uid+IN+%28SELECT+uid2+FROM+friend+WHERE+uid1%3D<userId>%29+AND+is_app_user%3D1&access_token=<appAccessToken>&format=json
So I tried using the user access token an as expected it works. I have searched a fair bit and came across this: Facebook 'Friends.getAppUsers' using Graph API
which has some great advice and led me to try the following query:
https://graph.facebook.com/<userId>/friends?fields=installed&access_token=<appAccessToken>&format=json
And this returns the list of friends with the app access token.
Which leads me to my question. Why am I unable to use the app access token with FQL to get a list of friends but I can retrieve the friends with the Graph API?
Thanks in advance,
Ben