title: Get friends using FQL with an application access token
body: <p>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 <a href="http://restfb.com" rel="nofollow noreferrer">RestFB</a> to run):</p>
  
  <pre><code>https://api-read.facebook.com/method/fql.query?query=SELECT+uid+FROM+user+WHERE+uid+IN+%28SELECT+uid2+FROM+friend+WHERE+uid1%3D&lt;userId&gt;%29+AND+is_app_user%3D1&amp;access_token=&lt;appAccessToken&gt;&amp;format=json
  </code></pre>
  
  <p>this returns an error:</p>
  
  <pre><code>..."error_code":102,"error_msg":"Requires user session"
  </code></pre>
  
  <p>Similarly if I try using FQL with the graph API (like below) I get the same error.</p>
  
  <pre><code>https://graph.facebook.com/fql?q=SELECT+uid+FROM+user+WHERE+uid+IN+%28SELECT+uid2+FROM+friend+WHERE+uid1%3D&lt;userId&gt;%29+AND+is_app_user%3D1&amp;access_token=&lt;appAccessToken&gt;&amp;format=json
  </code></pre>
  
  <p>So I tried using the user access token an as expected it works. I have searched a fair bit and came across this:
  <a href="https://stackoverflow.com/questions/2785093/facebook-friends-getappusers-using-graph-api">Facebook &#39;Friends.getAppUsers&#39; using Graph API</a></p>
  
  <p>which has some great advice and led me to try the following query:</p>
  
  <pre><code>https://graph.facebook.com/&lt;userId&gt;/friends?fields=installed&amp;access_token=&lt;appAccessToken&gt;&amp;format=json
  </code></pre>
  
  <p>And this returns the list of friends with the app access token.</p>
  
  <p>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?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Ben</p>