2020 — год, который мы запомним надолго. Партнёрский спецпроект 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.

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.

Features

Some endpoints require Features which must be approved through the App Review process before your app can use them in Live Mode. Refer to each endpoint's reference to determine which Page Features 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 except for pages_show_list and all 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.