Search this blog

Thursday, 2 March 2017

Generate permanent Facebook Page Access Token to access Graph API

Hello All,
Hope you are doing well

Earlier I have posted about using facebook graph api to get profile information, post status on facebook timeline and post as facebook page.

To Access Facebook graph API we need to use Access Token and each access token has it's expiry time (temporary access tokens) but to build an application we need a permanent access token so that our app doesn't stop working after a time and it is not very easy to get a permanent access token , there are some steps you need to follow to get one

Create a simple Website Facebook App (If you don't have one)

Go to Register and Configure an App and learn how to create a app then go to All Apps and add a new app

Generate Short lived Access Token

Select the app from application dropdown list

Click on Get Token --> Get User Access Token , In select permissions popup check manage_pages and click Get Access Token
Now you can see short lived access token appears in Access Token field

Generate Long lived Access Token

For this we need AppId and App Secret, Go to My Apps page and Open App and copy AppId and App Secret

Now make a GET request from your browser to get long lived access token

it'll return a long lived access token, 

you can check it's expiration time in Access Token Debugger 

Generate Permanent Access Token

Make a GET request to

It'll return a array of data[] that has permanent access token for all pages that you manage

Cheers :) Happy Learning


  1. the last step return empty data {
    "data": [


  2. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Your Domain Name