Last active
October 22, 2021 09:53
-
-
Save lucnap/9bc0a616b95180e7d938e963e220b638 to your computer and use it in GitHub Desktop.
How to get a Facebook Page Access Token that doesn't expire Never!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to get a Facebook Page Access Token that doesn't expire Never! | |
- Go to http://developers.facebook.com/tools/explorer/ | |
- Get a User Access Token with a permission "manage_pages" | |
- Convert this short-lived access token into a long-lived one by making this Graph API call: | |
https://graph.facebook.com/v2.6/oauth/access_token?client_id=<your FB App ID >&client_secret=<your FB App secret>&grant_type=fb_exchange_token&fb_exchange_token=<your short-lived access token> | |
- Make a call Graph API: | |
https://graph.facebook.com/v2.6/<your personal account FB user id>/accounts?access_token=<your long-lived access token> | |
- The returned access_token has no expiration unless you change your password or not more admin of the target page or deauthorize FB page | |
source: | |
http://stackoverflow.com/questions/17197970/facebook-permanent-page-access-token | |
http://stackoverflow.com/questions/12168452/long-lasting-fb-access-token-for-server-to-pull-fb-page-info |
I too get the same error. To be more specific:
Uncaught SyntaxError: Unexpected token :
I get
{
"data": []
}
as the output
I am not seeing manage_pages under the permission dropdown, even though I am an admin of the page? Please help.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When attempting to make the call to convert the short-lived to the long-lived I'm receiving this error. Any ideas?
{type: "http", message: "unknown error"}