title: Facebook graph API - OAuth Token
body: <p>I'm trying to retrieve data using the new graph API, however the token I'm retriving from OAuth doesn't appear to be working. </p>
  
  <p>The call I'm making is as follows;</p>
  
  <pre><code>$token = file_get_contents('https://graph.facebook.com/oauth/access_token?type=client_cred&amp;client_id=&lt;app_id&gt;&amp;client_secret=&lt;app secret&gt;');
  </code></pre>
  
  <p>This returns a token with a string length of 41. To give you an example of what is returned I have provided below a sample (converted all numbers to 0, all capital letters to 'A' and small case letters to 'a'</p>
  
  <pre><code>access_token=000000000000|AaaAaaAaaAAaAaaaaAaaAa0aaAA.
  </code></pre>
  
  <p>I take this access token and attach it to the call request for data, it doesn't appear to be the correct token as it returns nothing. I make the data call as follows; </p>
  
  <pre><code>file_get_contents('https://graph.facebook.com/&lt;my_page's_id&gt;/statuses?access_token=000000000000|AaaAaaAaaAAaAaaaaAaaAa0aaAA.')
  </code></pre>
  
  <p>When I manually retrieve this page directly through the browser I get an 500/Internal Server Error Message.</p>
  
  <p>Any assistance would be grately appreciated. </p>
  
  <hr>
  
  <p>Update: </p>
  
  <p>I've since changed the method from file_get_contents() to curl. By retreiving the headers I get the following error message ... </p>
  
  <pre><code>{"error":{"type":"OAuthException","message":"Missing client_id"}}
  </code></pre>
  
  <p>but my post array includes 'client_id'?!</p>