How to create never expires Access Token for Facebook Page

Facebook Long-Lived Token: Looking for never expiring facebook page access token, facebook access token, facebook app token?Follow the complete guide on how to generate the never expiring facebook access token to use with Facebook’s graph API to consume the real-time data.

1. Create an app from https://developers.facebook.com/ . Give necessary information and create the app.

- 0 6BmVGQNRry8SM nG - How to create never expires Access Token for Facebook Page

2. Create short lived user access token .

Go to tool explorer https://developers.facebook.com/tools/explorer/ and select the app created above and select “Get user access token in the drop down” .

- 0 sX22tT9bh7NjyjaS - How to create never expires Access Token for Facebook Page
Once you selected “Get user access token in the drop down” it will prompt following pop up . There you can select the permission(scopes) for the user access token.

Here I have selected “publish pages” and “manager pages” scopes which are need to create non expiry page access token.
- 0 qL xyMb09LVDKkvv - How to create never expires Access Token for Facebook Page

More detail about scopes can be found here
https://developers.facebook.com/docs/facebook-login/permissions

“This will create short lived user access token”

3. Create long lived user access token

Go to https://developers.facebook.com/tools/accesstoken/.There you will find short lived user access tokens and app access token of all the apps you have

- 0 MYWgeKxMywmLovSa - How to create never expires Access Token for Facebook Page

Press debug option of user access token of the app created above. This will take you to the debug tool. Where you can find all the information of short lived user access token.

In the bottom there is option to generate long lived(60 days) user access token for this short lived user access token. Generate long lived user access token by selecting “Extend Access Token”

- 0 cFS273l3nk4ziWwb - How to create never expires Access Token for Facebook Page

4. Create never expired page access token

a. Go to https://developers.facebook.com/tools/explorer/.

b. Paste the long lived user access token generated in previous step inside “Access token” field.

c. Access “/me/accounts” api . This will result page access tokens and pages related to them. These page access tokens will never expire(until user change the password/user revoke the app)

- 0 1ka 3EF3D9upB09w - How to create never expires Access Token for Facebook Page

5. Verify non expiry page access token

a. Go to https://developers.facebook.com/tools/debug/accesstoken/

b. Add the page access token retrieved from above step into “Access token “ field and debug

You will get expires as Never

- 0 ckW0cGFiHRVOKBhr - How to create never expires Access Token for Facebook Page

Facebook,API,Access Token,Page Access Token

Source: Jenananthan – medium.com

Leave a Reply

Your email address will not be published. Required fields are marked *