In this guide I will know how to get a Facebook Page Access Token.

Create Facebook App

  1. Go to developer page https://developers.facebook.com/apps
  2. Click a button Create App.
  1. On the form select an app type. Let it be Business.
  2. Press a button Next.
  3. Enter App name in display name field. It can be any.
  4. The same with a contact email field.
  5. After press a button Create App.

Than you will be redirected on App Dashboard.

  1. Navigate to the Setting -> Basic
  2. Remember App ID and App secret. We will use it in the next steps.

Generate a Short-lived User Access Token

After navigate to Facebook Graph Explorer. This tool helps us to get user and page access tokens.
First of all we need to get the user short-lived access token.

  1. Select an earlier created App in Facebook App list.
  2. Select Get User Access token in User or Page list.
  3. After you will see Facebook Login page. Follow Facebook instruction.
  4. If everything is fine you will get a short-lived access token in the Access Token field. Copy it.

Generate a Long-lived User Access Token

When we get a Short-lived access token, we can get a Long-lived access token for the user. Below you can see an URL that should be modified. Paste your APP-ID, APP-SECRET from the App Dashboard and Access Token that was earlier generated with Facebook Graph Explorer.

https://graph.facebook.com/
oauth/access_token?grant_type=fb_exchange_token&
client_id=APP-ID&
client_secret=APP-SECRET&
fb_exchange_token=SHORT-LIVED-USER-ACCESS-TOKEN
  1. Copy modified URL wihout https://graph.facebook.com/ and paste it to the Adress field on Facebook Graph Explorer.
  2. Click Submit
  3. After if an URL is correct you will get Long-lived access token for the user. Copy it.

Generate a Long-lived Page Access Token

Now we have a Long-lived user access token. It must be used to get a Long-lived Page Access Token.

  1. Copy URL path me?fields=accounts and paste it to the Adress field.
  2. Copy your Long-lived user access token and paste it to the Access Token field.
  3. Select your Facebook App
  4. Check that Permissions. Permissions pages_show_list and pages_read_engagement must be present. If it is false add them.
  5. Press the button Submit
  6. If everything is corectly configured you will get a response. Find an access_token field and copy it.