There are various guides, stackoverflow posts, youtube videos, etc on how to get a permanent page/user token for your Facebook application.
One use case: if a Facebook Page isn't completely public (not visible from incognito window), but you'd like to poll the Events that that Page has, you will need a permanent token for your app to view that data.
-
Get
app_id
andapp_secret
https://developers.facebook.com/apps -
Get
page_id
either from https://developers.facebook.com/apps or from page's About section -
Get
short_lived_token
from https://developers.facebook.com/tools/explorer- Facebook App: (Your app's name)
- User or Page: (Your page's name)
- Permissions: at least
user_events
Then copy the access token. This will be the
{short_lived_token}
-
Put
app_id
,app_secret
,page_id
andshort_lived_token
into config.ini, or pass them as CLI args -
python3 page.py
-
Get
app_id
andapp_secret
https://developers.facebook.com/apps -
Get
short_lived_token
from https://developers.facebook.com/tools/explorer- Facebook App: (Your app's name)
- User or Page: User Token
- Permissions: at least
manage_pages
Then copy the access token. This will be the
{short_lived_token}
-
Put
app_id
,app_secret
, andshort_lived_token
into config.ini, or pass them as CLI args -
python3 user.py