Facebook graph API - OAuth Token
Posted
by Simon R
on Stack Overflow
See other posts from Stack Overflow
or by Simon R
Published on 2010-04-23T08:47:14Z
Indexed on
2010/04/23
12:53 UTC
Read the original article
Hit count: 731
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.
The call I'm making is as follows;
$token = file_get_contents('https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=<app_id>&client_secret=<app secret>');
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'
access_token=000000000000|AaaAaaAaaAAaAaaaaAaaAa0aaAA.
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;
file_get_contents('https://graph.facebook.com/<my_page's_id>/statuses?access_token=000000000000|AaaAaaAaaAAaAaaaaAaaAa0aaAA.')
When I manually retrieve this page directly through the browser I get an 500/Internal Server Error Message.
Any assistance would be grately appreciated.
© Stack Overflow or respective owner