Skip to content

Instantly share code, notes, and snippets.

@beatwiz
Last active September 4, 2019 21:14
Show Gist options
  • Save beatwiz/0efb625c7b3e3f93fb6a5757e9850e4e to your computer and use it in GitHub Desktop.
Save beatwiz/0efb625c7b3e3f93fb6a5757e9850e4e to your computer and use it in GitHub Desktop.
Permanent Facebook Page Access Token

1) Create a new APP if needed

Default permissions, just need an APP id / APP secret

2) On the Facebook Graph API Explorer

https://developers.facebook.com/tools/explorer/

i) Choose the correct APP, and click on Get Token > Get User Access Token

ii) Copy the returned token

3) Open the following URL:

https://graph.facebook.com/v4.0/oauth/access_token?grant_type=fb_exchange_token&client_id=APP_ID&client_secret=APP_SECRET&fb_exchange_token=RETURNED_TOKEN

i) Copy the returned token

4) Open the following URL:

https://graph.facebook.com/v4.0/me?access_token=RETURNED_TOKEN_2

i) Copy the returned ID

5) Open the following URL:

https://graph.facebook.com/v4.0/RETURNED_ID/accounts?access_token=RETURNED_TOKEN_2

i) Copy the returned token (the never expiring one)

6) Test that is a non expiring token on the following URL (Access token debugger):

https://developers.facebook.com/tools/debug/accesstoken/

i) Paste the token

ii) Click debug

It should return Expires: Never

Congrats!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment