0
votes

I would like to show the posts from my Facebook page in another website using Graph API:

https://graph.facebook.com/[pageID]/feed?access_token=[accesstoken]

My question is, which access token should I use?

I have tried using my App Token, but I feel like I should be using other access tokens, how would I be able to obtain another Access Token?

1

1 Answers

0
votes

Depending on your use case there a three different options when it comes to the question of which access_token to use:

  1. Use any sort of access_token to get all posts that are public
  2. Use an user access_token to get all posts visible to the user the token belongs to
  3. Use a page access_token to get all posts

As far as I understand you, you want to get all posts from your page, regardless of any restrictions that may apply to a user that is viewing the feed (example: age restrictions, country restrictions). In that case use the page access_token for the page you want to get the feed from.

You can get the page token by calling /me/accounts [1], look for the page object and get the access_token for that page.

You can also read about it in the Graph API documentation [2] for pages.

[1] https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Faccounts&version=v2.0 [2] https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed#read