Ce document se rapporte à une fonctionnalité qui a été supprimée après API du graphe v3.2.
Version API du graphe

Video /{video-id}

An individual video on Facebook.

Reading

Graph API Explorer
GET /v21.0/{video-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{video-id}',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{video-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{video-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{video-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • You must use a valid Page Access Token or User Access Token for any video with public privacy settings.
  • For any videos uploaded by someone, and any videos in which they have been tagged - A user access token for that person with user_videos permission.

Fields

Property NameDescriptionType

id

The video ID.

string

created_time

The time the video was initially published.

datetime

description

The description of the video.

string

embed_html

The HTML element that may be embedded in a Web page to play the video.

string

format

The different formats of the video.

list<VideoFormat>

embed_html

HTML to embed the video in this format.

string

filter

The filter applied to this video format.

string

height

The height of the video in this format.

integer

picture

The thumbnail for the video in this format.

string

width

The width of the video in this format.

integer

event

Event associated with the video.

Event

from

The profile that created the video.

Profile

icon

The icon that Facebook displays when videos are published to the feed.

string

name

The video title or caption.

string

picture

The URL for the thumbnail picture of the video.

string

place

Location associated with the video.

Page

source

A URL to the raw, playable video file.

string

updated_time

The last time the video or its caption was updated.

datetime

Publishing

You can publish videos by using the /{user-id}/videos, /{event-id}/videos, and /{page-id}/videos edges.

Edges

Property NameDescription

/likes

Profiles that like this video.

/comments

Comments on this video.

/sharedposts

Posts that share this video.

/captions

Captions for this video.