Getting a permanent Facebook Page Access token

facebookCommunicating with a Facebook page is very important for developers to perform different action from the software they are developing without opening Facebook. This is very useful for Back-ends  and CMS’s. To be able to communicate with a Facebook Page you need some sort of authentication, in this case it is called Access Token. There is 2 types of access tokens with facebook, there is the temporary access toke, which is the most common and the Permanent Access Token. in our case we will explain how to get a permanent access token for a facebook page because it’s more useful for developers. Steps to get a Facebook Page Access Token that Doesn’t expire

1.	Make sure you are the admin of the FB page you wish to pull info from
2.	Create a FB App (should be with the same user account that is the page admin)
3.	Head over to the Facebook Graph API Explorer
4.On the top right, in "Application", select the app you created
5.	Click "Get Access Token"
6.	Make sure you add the manage_pages permission
7.	Convert this short-lived access token into a long-lived one by making this Graph API call:https://graph.facebook.com/oauth/access_token?client_id=&client_secret=&grant_type=fb_exchange_token&fb_exchange_token=
8.	Grab the new long-lived access token returned back
9.	Make a Graph API call to see your accounts using the new long-lived access token:https://graph.facebook.com/me/accounts?access_token=
10.	Grab the access_token for the page you'll be pulling info from
11.	Lint the token to see that it is set to Expires: Never!

PS: don’t share this access token anywhere and keep it in a secure place, anyone having this access token can control our Facebook Page.

Do you have another way, or this is not working for you ? Let us know in the comments below

Hopes this was useful!! Happy programming 🙂

Leave a Reply