Graph API Version

Group Videos

Videos owned by a Facebook Group.

Use of this endpoint requires App Review. Apps that have already been approved to access this endpoint have until August 1, 2018, to resubmit for review or lose endpoint access.

Reading

Returns an array of Video objects.

Graph API Explorer
GET /v3.2/{group-id}/videos 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(
    '/{group-id}/videos',
    '{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(
    "/{group-id}/videos",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/videos",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}/videos"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Requirements

Type of RequirementDescription

App Review

Your app must be approved for the Groups API feature.

App Installation

The app must be installed on the Group.

Tokens

A User access token.

Creating

Upload a video to a Group.

The publish_actions permission has been deprecated. If your app has already been approved for this permission, you can continue using it to publish videos until August 1, 2018. To publish videos to User timelines, Groups, or Pages after that date, please use the Sharing Dialog.

POST /v3.2/{group-id}/videos HTTP/1.1
Host: graph-video.facebook.com

source=%7Bvideo-data%7D
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{group-id}/videos',
    array (
      'source' => '{video-data}',
    ),
    '{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(
    "/{group-id}/videos",
    "POST",
    {
        "source": "{video-data}"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("source", "{video-data}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/videos",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"source": @"{video-data}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}/videos"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Supported Formats

3g2, 3gp, 3gpp, asf, avi, dat, divx, dv, f4v, flv, m2ts, m4v, mkv, mod, mov, mp4, mpe, mpeg, mpeg4, mpg, mts, nsv, ogm, ogv, qt, tod, ts, vob, wmv.

Resumable Upload

Starting with Graph API v2.3+, you can perform resumable uploads for video chunks with the following edges:

  • user/videos
  • event/videos
  • page/videos
  • group/videos

For more information, see the Video Upload with Graph API tutorial.

Requirements

NameDescription

App Review

Your app must be approved for the following login permissions and features: (Click to expand)

Login permissions

publish_to_groups

Features

Groups API

App Installation

The app must be installed on the Group.

Tokens

A User access token for a user who is a member of the Group where the app is installed.

Permissions

The user must grant your app the publish_to_groups permission.

Limitations

  • Videos must be encoded as multipart/form-data and published to the graph-video.facebook.com host URL.
  • The aspect ratio of the video must be between 9x16 and 16x9.
  • If you upload a video with a multi-part HTTP request or by providing a URL to a video, the video cannot exceed 1GB in size and 20 minutes in duration.
  • Resumable video upload supports videos up to 1.5GB and 45 minutes long.

Fields

Name Description Type

id

The target ID where the video is posted to.

numeric string

title

The title of the video.

string

description

The description of the video, used as the accompanying status message in any feed story. This parameter can contain mentions of other Facebook Pages using the following syntax:

@[page-id]

For example the following description would mention the Facebook Developers page inline:

Test message @[19292868552] tag

Usage of this feature is subject to review but by using Pages you are an admin of (both to make the API call, and to be used in a mention), and an app you are a developer of, you can test it for yourself before review.

string

source

The video, encoded as form data. This field is required.

multipart/form-data

file_url

Accessible URL of a video file. Cannot be used with upload_phase.

string

thumb

The video thumbnail raw data to be uploaded and associated with a video.

image

upload_phase

Type of chunked upload request.

enum{start, transfer, finish}

file_size

The size of the entire video file in bytes.

unsigned int32

start_offset

Start byte position of the file chunk.

unsigned int32

video_file_chunk

The video file chunk, encoded as form data. This field is required during transfer upload phase.

multipart/form-data

upload_session_id

ID of the chunked upload session.

numeric string

Response

If successful:

Struct {
  id: numeric string,
  upload_session_id: numeric string,
  video_id: numeric string,
  start_offset: numeric string,
  end_offset: numeric string,
  success: bool,
  skip_upload: bool,
}

Otherwise a relevant error message will be returned.

Updating

This operation is not supported.

Deleting

This operation is not supported.