-1

I'm facing trouble in getting access_token which I need to use in displaying ANY facebook feed on the website.

I have followed the instructions here in that given link, facebook: permanent Page Access Token?, but sadly not worked for me.

Below are my API details and my requirement is to display ANY facebook page posts via PHP code in my website.

App ID: 1250216098473345 App Secret: c637f7640a185b8137e567295abe568f

All I need is a non-expire access token to put in my code to display feeds.

$userPosts = $fb->get('/ESPN/posts?fields=story,shares,likes.summary(true),comments.summary(true),full_picture,permalink_url,message,updated_time&limit=8', $accessToken);

Tried given tokens to display data of public fb pages, but failed.

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

https://graph.facebook.com/oauth/access_token?client_id=1250216098473345&client_secret=c637f7640a185b8137e567295abe568f&grant_type=fb_exchange_token&fb_exchange_token=EAARxEJ5xJYEBAGXFLgn98sPHGqZA74pkipbxLPTCn0jx7vtZBipmoPcG7CYaBXqRol2IUhtAI9wlX4bpFOJ1oGWSEmucCzUYKQnCwH42BnCEZARuIgEPGR3r0ZCjvI343S5yLd1C8mPLQJHNKiAOskwhmP4FU0ZC6eEvVOZB1XnWYleZA639EntpCYedUNp9itjy9c2joZBZBqAZDZD

Max
  • 11
  • 4

1 Answers1

0

First of all you shouldn't share you app secret publicly (hence the name).

There is no token that would allow you to display any Facebook page feed. Looking at your example call you most likely refer to pages you or your app users don't have a role in therefore you can apply for Page Public Content Access feature which then would allow you to access public page's data/feeds.

The other option would be requesting manage_pages permission from a page admin for the specific page you want to access.

lars.schwarz
  • 1,246
  • 1
  • 8
  • 12
  • I want you to please take a look at these links, [https://smashballoondemo.com/?id=espn](https://smashballoondemo.com/?id=espn) and [https://www.juicer.io/](https://www.juicer.io/), they are showing **ANY** public FB page feeds. I want the same result to display feeds of FB pages but via PHP code. – Max Jun 27 '19 at 07:07
  • Like explained in my answer this would require Page Public Content Access feature reviewed and approved. – lars.schwarz Jul 01 '19 at 12:16