Skip to content

Latest commit

 

History

History
133 lines (68 loc) · 6.11 KB

CaptionsApi.md

File metadata and controls

133 lines (68 loc) · 6.11 KB

CaptionsApi

All URIs are relative to https://ws.api.video

Method Description HTTP request
upload() Upload a caption POST /videos/{videoId}/captions/{language}
get() Retrieve a caption GET /videos/{videoId}/captions/{language}
update() Update a caption PATCH /videos/{videoId}/captions/{language}
delete() Delete a caption DELETE /videos/{videoId}/captions/{language}
list() List video captions GET /videos/{videoId}/captions

upload() - Upload a caption

Upload a VTT file to add captions to your video. More information can be found here

Parameters

Name Type Required Description
videoId string yes The unique identifier for the video you want to add a caption to.
language string yes A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter only accepts dashes for separators, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags here.
file string | Readable | Buffer yes The video text track (VTT) you want to upload.

Return type

Promise<Caption>.


get() - Retrieve a caption

Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found.

Tutorials that use the captions endpoint.

Parameters

Name Type Required Description
videoId string yes The unique identifier for the video you want captions for.
language string yes A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter only accepts dashes for separators, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags here.

Return type

Promise<Caption>.


update() - Update a caption

To have the captions on automatically, use this method to set default: true.

Parameters

Name Type Required Description
videoId string yes The unique identifier for the video you want to have automatic captions for.
language string yes A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter only accepts dashes for separators, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags here.
captionsUpdatePayload CaptionsUpdatePayload yes

Return type

Promise<Caption>.


delete() - Delete a caption

Delete a caption in a specific language by by video id.

Parameters

Name Type Required Description
videoId string yes The unique identifier for the video you want to delete a caption from.
language string yes A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter only accepts dashes for separators, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags here.

Return type

Promise<void>.


list() - List video captions

Retrieve a list of available captions by video id.

Parameters

Name Type Required Description
videoId string yes The unique identifier for the video you want to retrieve a list of captions for.
currentPage number no Choose the number of search results to return per page. Minimum value: 1
pageSize number no Results per page. Allowed values 1-100, default is 25.

Return type

Promise<CaptionsListResponse>.