Как стать счастливее и уверенно идти к своим целям? Все ответы — в книге «Сам себе государство. Как совершить революцию в жизни». Подпишитесь на рассылку, чтобы не пропустить предзаказ Overview - Pages - Documentation - Facebook for Developers

Overview

The Pages API is a set of Facebook Graph API endpoints that apps can use to create and manage a Page's settings and content. If you are unfamiliar with the Graph API, please read our Graph API documentation before proceeding.

Components

Access Tokens

API authentication is handled through Access Tokens. Most endpoints require Page access tokens, which are unique to each Page, app User, and app, and have an expiration time. In order to get a token from an app User, the app User must own or be able to perform a Task on the Page.

You can get access tokens from your app Users by implementing Facebook Login.

For Pages that have been migrated to the New Page Experience, a Page access token is now required for all available endpoints with the follwing exceptions:

Permissions

Most endpoints require one or more permissions which must be granted by your app Users through the use of Facebook Login. All Page permissions require App Review before your app can use them to access in.

Beginning October 14, 2020, the pages_show_list permission will require App Review.


You will need to request access through App Review if:

  • Your app is requesting the pages_show_list permission for the first time.
  • Your app has not used the pages_show_list permission within the last 90 days.

If your app has previously been approved for any of the following permissions through App Review no action is required:

Features

Some endpoints require a Feature which must be approved through the App Review process before your app can use them in Live Mode. Features allow you to access public Page data without a permission or the ability to perform a task on the Page. Refer to each endpoint's reference to determine which Page Feature it requires.

Tasks

Tasks allow Users to perform specific actions on a Page. When a User uses an app to interact with a Page, depending on the attempted action, we will first check if the User has been approved for a task that permits that type of action.

Page-Scoped User IDs

Users who interact with Pages are identified by Page-Scoped User IDs (PSID). PSIDs are IDs that are unique to each User-Page pair. Pages API and Messenger API endpoints rely on PSIDs, so you can use a PSID to identify a User's interactions with a Page, as well as the User's public Messenger conversations with that Page.

App-Scoped User IDs

Before May 1, 2018, Pages API endpoints relied on App-Scoped User IDs (ASID). Apps created before this date continued receiving ASIDs in endpoint responses, unless an app admin used the App Dashboard to opt-in to receive PSIDs. Starting with v7.0+, Pages API endpoints will only accept and return PSIDs for all apps, regardless of their creation date. This change will also be applied to all API versions on May 5th, 2021.

The Page-Scoped ID API allows you to map ASIDs to their PSID equivalents. The API is deprecated in v7.0+, but can be used with older versions until May 5th, 2021.

Rate Limits

All Pages endpoint requests are subject to Rate Limiting. You can see your app's current call count consumption in the App Dashboard.

App Review

All Page-related Permissions and Features require approval through the App Review process before your app can use them while in Live Mode.

Apps in Development Mode can request any Permission from any app User who has a Role on the app.

How It Works

This is a typical flow for accessing the Pages API:

  1. Get a User Access Token from the app User through Facebook Login.
  2. Query the /me/accounts endpoint to get the ID and Page Access Token of the Page the app User has permitted your app to access.
  3. Capture the returned Page ID and Page Access Token.
  4. Use the ID and token to query the Page node.

Note that in some cases the app User may grant your app access to more than one Page, in which case you should capture each Page ID and its respective token, and provide a way for the app User to target each of those Pages.

Next Steps

Follow our Get Started guide to learn how to create a Page and post to it using the Pages API.