title: Getting access token for CURL/Browser Graph API
body: <p>I'm trying to obtain messages and attachments from Facebook, I'm using:</p>
  
  <pre><code>https://api.facebook.com/method/message.getThreadsInFolder?access_token=AT&amp;folder_id=0
  </code></pre>
  
  <p>To get the list of threads and:</p>
  
  <pre><code>https://graph.facebook.com/fql?access_token=AT&amp;q=QUERY
  </code></pre>
  
  <p>For my queries.</p>
  
  <p>But, every time, I copy the access token generated by the Graph API Explorer as I don't seem to be able to get it programmatically:</p>
  
  <pre><code>https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&amp;client_id=ID&amp;client_secret=SECRET
  </code></pre>
  
  <p>Gives me an access token, but it doesn't work. If I try to use it with the URLs above I get:</p>
  
  <pre><code>"error_msg":"A session key is required for calling this method"
  </code></pre>
  
  <p>And for the second one:</p>
  
  <pre><code>  "message": "Invalid OAuth access token.",
    "type": "OAuthException",
    "code": 190
  </code></pre>
  
  <p>The Facebook documentation it's really unclear.</p>
  
  <p>I do not want to use a login flow, is there a way to login programmatically with the stored credentials as the mobile application does?</p>