Access "Public" Graph API applications from within an application?

I am creating a web application that is trying to use the "public" content of Facebook.

This is not your traditional “Facebook app”, because I do not sign Facebook to use it, but users will be on the server side.

I came to the point where I need to use "access_token" for certain "public" pieces of content, and I was able to create an access_token application, but this does not work for public data I'm interested in access.

access_token created using

https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=client_credentials 

don't work for

 https://graph.facebook.com/chickfila/notes?access_token=CODE_FROM_ABOVE 

which is available to the public without registering here ...

 http://www.facebook.com/ChickfilA?sk=notes 

In any case, to attach the application to the user level access_token?

+8
facebook facebook-graph-api
source share
3 answers

I had a very similar problem with publicly available event data. I had to make an anonymous access token for the application administrator.

So, log in with your administrator and open the following URL (replace the APP ID with your ID and, ultimately, you need more permissions, but read_stream and offline_access should do the trick):

 https://graph.facebook.com/oauth/authorize?client_id=APPID&scope=offline_access,read_stream&redirect_uri=http://www.facebook.com/connect/login_success.html 

This will give you the code that you will embed in the following URL (with your APP ID and SECRET):

 https://graph.facebook.com/oauth/access_token?client_id=APPID&redirect_uri=http://www.facebook.com/connect/login_success.html&client_secret=SECRET&code=CODE 

This will give you an access token that should work forever (or until you change your password).

+7
source share

Recently, I used an access token, freely available from Facebook Graph Explorer , which will allow you to view different graph resources and allow you to specify which permissions you need. For this, you can say that you want offline_access and this token to be used to extract this information whenever necessary, without worrying about the expiration of your token.

+4
source share

Create a user only for your application and allow the user to authorize your application and get an access token and use it for this kind of data extraction. Some manual work, but as long as you have a specific authorized access token, you should get public content.

+3
source share

All Articles