Longevity Hacks: Long-Live Access Token Token for Your Facebook Page
1. Login to your Facebook and visit the developer’s section.
Let’s whip up an awesome app together! Head on over to https://developers.facebook.com, provide all the essential info, and let’s get that app created!
2. Create a short-lived user access token.
Head over to the Tool Explorer at this link: https://developers.facebook.com/tools/explorer/. Once you’re there, simply pick the app you created earlier, and from the dropdown menu, select Get user access token.
After choosing “Get user access token” from the dropdown menu, a friendly pop-up will appear. In this pop-up, you’ll be able to pick the specific permissions (scopes) you want for your user access token.
For instance, I’ve gone ahead and selected the “publish pages” and “manage pages” scopes, which are necessary to create a page access token that never expires.
You can find lots more information about scopes right here: https://developers.facebook.com/docs/facebook-login/permissions
“This will create a short-lived user access token“
3. Create a long-lived access token for a user
Visit this link: https://developers.facebook.com/tools/accesstoken/. Once you’re there, you’ll discover short-lived user access tokens and app access tokens for all your apps!
Sure, here’s a friendlier version: “Simply click on the ‘Debug’ option for the user access token you generated for your app earlier. This will whisk you away to the marvelous debug tool, where you’ll uncover all the juicy details about your short-lived user access token.
At the bottom, you’ll find an option to create a user access token that lasts for a generous 60 days, extending the life of your current token. To get your hands on this longer-lasting token, simply choose “Extend Access Token.”
4. Create never expired page access token
- Go to https://developers.facebook.com/tools/explorer/
- Go ahead and pop that trusty, long-lasting user access token you created in the previous step right into the “Access token” field.
- To get access to the “/me/accounts” API, you’ll receive page tokens and the pages associated with them. The cool thing is, that these page access tokens won’t ever expire unless you decide to change your password or revoke the app.
5. Verify non-expiry page access token
- Go to https://developers.facebook.com/tools/debug/accesstoken/
- Simply take the page access token you obtained in the previous step and pop it into the “Access token” field, and let’s go ahead and check for any issues together.
You’ll never have to worry about it expiring!