Login to Meta for Developers and note down the App ID and App Secret of the app.
Access Tokens – https://developers.facebook.com/docs/pages/access-tokens/
https://developers.facebook.com/apps/
To get the long-lived page access token, first, we need to generate a short-lived Access Token.
In Graph API Explorer – https://developers.facebook.com/tools/explorer, select the App and the page (provide appropriate permissions) and click on Generate Access Token to generate the token.
Navigate to Access Token Debugger – https://developers.facebook.com/tools/debug/accesstoken/, paste the token and click on Debug.
We can see the token expiry in 1 hour.
To generate a Permanent or Long-lived token we can make use of the below application.
https://bnjis.github.io/Facebook-permanent-token-generator/
Specify App ID, App Secret, and User Access Token and click on Submit.
We will get the permanent token generated for us.
On pasting this token in the Access Token Debugger, we can see the expiry set to Never.
The other option is to use the Extend Access Token option when we generate a short lived token
Check the below link for more details –
https://developers.facebook.com/docs/marketing-apis/overview/authentication/
https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived/
https://medium.com/@blienart/get-a-permanent-facebook-page-access-token-a96470dc03ca
https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension
Hope it helps..