Este documento se ha actualizado.
La traducción en Español (España) no está disponible todavía.
Actualización del documento en inglés: 21 jun.
Actualización del documento en Español (España): 16 mar. 2023

Get Started

The Get Started with the Facebook Video API from Meta guide shows you how to obtain a permissions, a Page access token, and a Page ID using the Graph API Explorer.

Before You Start

You will need:

Step 1: Get an access token

In this section you will beusing the Graph API Explorer to get an access token for your Page with the necessary permissions

  1. Load the Graph API Explorer in a new window.
  2. Select your app from the Meta App dropdown menu.
  3. In the User or Page drop-down menu, select User Token.
  4. In the Permissions section, use the Add a permission search field to search for and select the following permissions:
    • pages_manage_engagement
    • pages_read_user_content
    • pages_show_list
  5. Click Generate Access Token.
  6. In the pop-up window that appears, select the Page where you want to publish your video and complete the pop-up window flow.

You now have a User access token that you can use to make API requests. You can copy and paste this token to test your app and click the i icon to view details about this token including permissions and expiry.

Step 2: Get your Page ID and token

  1. In the Graph API Explorer, update the query string field a request to the GET /me/accounts endpoint. me represents the ID for the User or Page that requested the access token, in this query the ID is your User ID.
  2. Click Submit in the upper right. A list of Page objects will be returned, including the name, Page ID, and Page access token, for Facebook pages on which you can perform a task.
  3. Copy the ID for your Page and Page access token.
  4. {
      "data": [
        {
          "access_token": "EBACf...",  //Copy your Page Access Token
          "category": "Media",
          "category_list": [
            {
              "id": "163003840417682",
              "name": "Media"
            }
          ],
          "name": "Metricsaurus",
          "id": "1755847768034402",  //Copy your Page ID
          "tasks": [
            "ANALYZE",
            "ADVERTISE",
            "MODERATE",
            "CREATE_CONTENT",
            "MANAGE"
          ]
        }
      ],
      "paging": {
        "cursors": {
          "before": "MTc1NTg0Nzc2ODAzNDQwMgZDZD",
          "after": "MTc1NTg0Nzc2ODAzNDQwMgZDZD"
        }
      }
    }
    

Step 3. Publish the video to your Page

  1. In the explorer, replace me with your Page ID.
  2. Replace the access token with your Page access token.