0

I have an album which is public and I want to expose it through my site via PHP.

The documentation at https://developers.facebook.com/docs/graph-api/reference/v2.6/album says that I need an access token, however I don't want to have the user login to facebook just to see my public photos.

How do I get such a "generic" access token?

Thanks.

Michael Chourdakis
  • 10,345
  • 3
  • 42
  • 78
  • may help http://stackoverflow.com/questions/5945720/how-to-display-my-photo-albums-and-photos-that-are-in-fb-on-my-own-website – Madhawa Priyashantha Jun 14 '16 at 15:55
  • 1
    I believe what you're after is an `App Access token`? (Note will only work if the album is "public") https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens – Jonnix Jun 14 '16 at 15:55
  • I 've tried it ... $AppToken = $fb->get('oauth/access_token?client_id=....&client_secret=...&grant_type=client_credentials'); It returns an object in which $AppToken->getAccessToken() returns null. – Michael Chourdakis Jun 14 '16 at 16:52

2 Answers2

1

If it´s about an album on a User Profile, you have to use a User Token - even if the album is public. If it´s about an album on a Page, you can use an App Token or an Extended Page Token.

User Tokens are valid for 2 hours, but you can extend them to 60 days. There is no User Token that is valid forever. App Tokens and Extended Page Tokens are valid forever in general.

More information:

andyrandy
  • 72,880
  • 8
  • 113
  • 130
0

Facebook access token is used to authenticate applications, the user who create or owns the Facebook application. Once you received access token, you can store that token and use it to make requests to Facebook.

Atul Jindal
  • 946
  • 8
  • 8