Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook API without client authentication for public content

I'm developing a site for a client who already have the photos of his products on Facebook, and he wants the same albums to be replicated over his site. I was already using Facebook Connect, so I dropped a combination of photos.getAlbums and photos.get to dynamically make the galleries.

So far so good, but then I realized that if there's no user logged trough FBC, no session is created and the API becomes unusable, even for content that is publicly available. I obviously want to show the albums to everyone and not just the people who connect their accounts.

Is this how all functions in the Facebook API work? What's the best (easier to implement) workaround for this situation?

like image 373
lima Avatar asked Jun 16 '09 10:06

lima


People also ask

Can I use Facebook API for free?

The Graph API is free to use, for all applicable use cases. Rate Limiting applies though, > developers.facebook.com/docs/graph-api/advanced/rate-limiting There is no way to “pay” or > otherwise get those limits raised for normal 3rd party apps.

Does Facebook have a public API?

With the Facebook API, you can access and read public data for Facebook Pages that you are not the admin of. This data, including business metadata, public comments, and posts, can be used for competitive analysis and benchmarking.

What API is the primary way to get data into and out of the Facebook?

The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.


2 Answers

For the record, I managed to solve this situation by developing a small backend that requires the client to login to Facebook once and give offline_access extended permission to the FB app, so I can save his session key and use it to authenticate the Facebook API client every time I need to use FQL to get non-public content.

One could obviously add some caching in the middle to avoid unnecessary requests to Facebook, but it's been working fine for months now without hitting any limits that I know of.

like image 37
lima Avatar answered Sep 20 '22 17:09

lima


As of September 2010, you can now authenticate just as an application, with no associated user. See http://developers.facebook.com/docs/authentication/ for details. Or you can run this example code to get an access token:

curl -F grant_type=client_credentials \
 -F client_id=your_app_id \
 -F client_secret=your_app_secret \
 https://graph.facebook.com/oauth/access_token
like image 187
lacker Avatar answered Sep 21 '22 17:09

lacker