I have been trying to find a way to create a never expiring FaceBook Page Access Token. I have seen the option where you provide the AppID|AppSecret in place of the token however that requires you to submit the app for approval and facebook does not seem to understand concept of OTHER apps using the token. Regardless, see the answer below for how I found a way to do this.
After piecing together many different solutions - I did this and it seems to work. I assume you only want a token for a single page and that you already have your Facebook app page setup.
Get the ID of the page by navigating to it from a web browser, click on About link in the menu list down the left hand side of the page, then scroll to the bottom of the About information and you will see the Page ID display.
Navigate to Facebook Graph API Explorer
Remove everything after the API Version (in this case v3.2) on this line of the explorer
and replace it with 123456789?fields=access_token where 123456789 is your page ID.
Click the Submit button to the right hand side of the line you just entered the text into.
- You will receive a token back in the response at the bottom of the screen that looks similar to this:
{ "access_token": "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT", "id": "1755746091324056" } where TTTTTTTT is your access token.
- Copy the token only (no quotes) out of the response and past it in the Access Token field at the top of the Page replacing the Access Token that was previously there.
After pasting in the new access token click on the blue information icon to the left of the access token.
In the Access Token Information dialog, click on the 'Open in Access Token Tool' button at the bottom right of the dialog.
- In the Access Token Debugger that will open up, click on the 'Extend Access Token' button at the bottom of the page. A new access token should be displayed and the text above it should say that it never expires.
I hope this helps.
PS - Here is what I see in Facebook's Access Token tool when I paste the token generated using this method into it. It says this token will never expire.
Go to your Business settings page, you can get there from your app:
Create a new System user with the admin role:
Click on add assets and give the system user full control on the page and on your app:
Click on generate new token and click on never, make sure of putting the permission you need:
With that token, use the following URL to generate your page access token without an expiry date:
https://graph.facebook.com/{PAGE-ID}?fields=access_token&access_token={TOKEN}
After a lot of searching, that method worked for me.
© 2022 - 2024 — McMap. All rights reserved.