Graph API Version

Video Captions

Reading

Captions for the video.

Graph API Explorer
GET /v2.10/{video-id}/captions HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{video-id}/captions'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{video-id}/captions",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{video-id}/captions",
    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:@"/{video-id}/captions"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
No data
Page management Apps
  • manage_pages
  • pages_show_list
Other Apps
No data

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of VideoCaption nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
100Invalid parameter

Creating

You can't perform this operation on this endpoint.

Updating

You can update a VideoCaption by making a POST request to /{video_id}/captions.

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
No data
Page management Apps
  • pages_show_list
  • publish_actions
  • user_videos
Other Apps
  • publish_actions
  • user_videos

Parameters

NameDescription
captions_file
file

Caption file in SRT (SubRip Text) format. File name must be in the format filename.locale.srt

default_locale
string

Specify which locale should be used as the default for the video. Can be set to 'none'

locales_to_delete
list<string>
Default value: Vector

locales of caption to delete

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Validation Rules

ErrorDescription
386You uploaded a .SRT file with an incorrect file name. Please use this format: filename.en_US.srt
482The captions files you selected contain locales that had been applied to video, please remove and try again.
385Sorry, the captions file you selected is in a format that we don't support.
100Invalid parameter
387There was a problem uploading your captions file. Please try again.
368The action attempted has been deemed abusive or is otherwise disallowed
200Permissions error
388The captions file you tried to upload is too large. Please try again with a smaller file.

Deleting

Permissions

To delete a video's caption you need:

  • publish_actions permissions for a user's, group's, or event's video.
  • manage_pages permission for a page's video.


You can dissociate a VideoCaption from a Video by making a DELETE request to /{video_id}/captions.

Parameters

NameDescription
locale
string

Specify which locale should be deleted

Required

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
387There was a problem uploading your captions file. Please try again.
200Permissions error