เวอร์ชันของ API กราฟ

Video Captions

การอ่าน

VideoCaptions

ตัวอย่าง

Graph API Explorer
GET /v19.0/{video-id}/captions 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}/captions',
    '{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}/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();
/* 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
}];
หากคุณต้องการเรียนรู้วิธีใช้ API กราฟ โปรดอ่านคู่มือการใช้ API กราฟของเรา

พารามิเตอร์

จุดสิ้นสุดนี้ไม่ต้องพารามิเตอร์ใดๆ

ช่อง

การอ่านจากจุดเชื่อมโยงนี้จะให้ผลลัพธ์ที่อยู่ในรูปแบบ JSON:

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

data

รายชื่อของโหนด VideoCaption

paging

หากต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับการแบ่งหน้า โปรดดูคำแนะนำ API กราฟ

Error Codes

ข้อผิดพลาดคำอธิบาย
104Incorrect signature

การสร้าง

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้

กำลังอัพเดต

Permissions

To update a video's caption, you need one of the following:

  • User is the owner of the video
  • User has manage access on page that owns the video
  • User has advertiser access on account that owns the video

Limitations

The file size limit for video captions is 200K.

คุณสามารถอัพเดต a Video ได้โดยส่งคำขอ POST ไปที่ /{video_id}/captions

พารามิเตอร์

พารามิเตอร์คำอธิบาย
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>
ค่าเริ่มต้น: Vector

locales of caption to delete

ประเภทการส่งกลับ

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

Error Codes

ข้อผิดพลาดคำอธิบาย
482The captions files you selected contain locales that had been applied to video, please remove and try again.
100Invalid parameter
387There was a problem uploading your captions file. Please try again.
386You uploaded a .SRT file with an incorrect file name. Please use this format: filename.en_US.srt

กำลังลบ

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้