這份文件已更新。
中文(香港) 的翻譯尚未完成。
英文更新時間:10月25日
中文(香港) 更新時間:2022年12月7日

Overview for the Video API from Meta

The Video API is a collection of Graph API endpoints that allow apps to publish existing videos on Pages administered by app users.

Components

Host URL

All requests are passed to the graph.facebook.com host URL.

The graph-video.facebook.com host for video uploads has been deprecated. Use the graph.facebook.com host for API requests when uploading videos to Meta servers.

Upload Protocols

Upload videos using the Resumable Upload API.

Resources

The API uses the following nodes.

Videos

The Video node is the API's primary resource. When you upload an existing video the API generates a Video entity and publishes it on a Page. Videos must be published on a target node.

Pages

Videos can be published on a Page as long as the app user can perform admin-equivalent Tasks on the Page, or have been granted an Admin Role on the Page via the Business Manager.

Crossposted Videos

Videos that have already been published can also be published on other Pages that the app user administers without having to be reuploaded. Insights on Crossposted Videos can be returned as aggregate values (e.g. the sum of all views across all Pages) or broken down by Page.

Slideshows

You can use the API to generate a slideshow Video from a collection of images hosted on a public server.

Polls

You can use the API to create Polls on published videos and get their results.

Ads

Published Videos can be used with the Marketing API's Ad Creative endpoint to create Video Ads.

Insights

You can get insights on any published Video. Insights for Crossposted Videos can be returned as aggregate values or broken down by Page.

Webhooks

You can receive real-time notifications of changes to a Video's publishing status and viewer interactions by setting up Page Webhooks. Set up a callback and then subscribe to the Page topic's feed and videos fields to receive notifications. Note that notification will not be sent for videos that are uploaded as secret or no_story.

Rights Management

For Videos published on a Page, you can use the Rights Manager API to create and apply copyright rules in order to discover other published Videos that may be in violation, and report them.

Requirements

Permissions

To publish on a Page, the app user must grant your app the pages_show_list, pages_read_engagement, and pages_manage_posts permissions.

Admin Role

The app user must be able to perform the equivalent of ADMIN tasks on the targeted Page.

App Review

All permissions require App Review.

How It Works

The general flow for publishing a video on a Page is to:

  1. Get an Access Token and appropriate permissions from your app user
  2. Get a list of Pages that the app user is able to perform admin-equivalent Tasks on
  3. Provide a way for the app user to select the Page where they want the video to appear
  4. Provide a way for the app user to select a Video to be published.
  5. Upload the video using the Resumable Upload API
  6. Publish the video to the Page using the Video ID