# ApiVideo\Client\Api\CaptionsApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**delete()**](CaptionsApi.md#delete) | **DELETE** `/videos/{videoId}/captions/{language}` | Delete a caption
[**list()**](CaptionsApi.md#list) | **GET** `/videos/{videoId}/captions` | List video captions
[**get()**](CaptionsApi.md#get) | **GET** `/videos/{videoId}/captions/{language}` | Show a caption
[**update()**](CaptionsApi.md#update) | **PATCH** `/videos/{videoId}/captions/{language}` | Update caption
[**upload()**](CaptionsApi.md#upload) | **POST** `/videos/{videoId}/captions/{language}` | Upload a caption


## delete()


Delete a caption in a specific language by providing the video ID for the video you want to delete the caption from and the language the caption is in.

```php
delete(string $videoId, string $language): void
```

### Arguments



Name | Type | Description  | Example | Notes
------------- | ------------- | ------------- | ------------- | -------------
 `videoId` | **string**| The unique identifier for the video you want to delete a caption from. | `vi4k0jvEUuaTdRAEjQ4Prklgc` |
 `language` | **string**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. | `en` |




### Return type

void (empty response body)

### Authorization

[bearerAuth](../../README.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## list()


Retrieve a list of available captions for the videoId you provide.

```php
list(string $videoId, array $queryParams = []): \ApiVideo\Client\Model\CaptionsListResponse
```

### Arguments


Name | Type | Description  | Example | Notes
------------- | ------------- | ------------- | ------------- | -------------
 `videoId` | **string**| The unique identifier for the video you want to retrieve a list of captions for. | `vi4k0jvEUuaTdRAEjQ4Prklg` |


Note: `$queryParams` argument is an associative array with the keys listed below.

Name | Type | Description  | Example | Notes
------------- | ------------- | ------------- | ------------- | -------------
 `currentPage` | **int**| Choose the number of search results to return per page. Minimum value: 1 | `2` | [optional] [default to 1]
 `pageSize` | **int**| Results per page. Allowed values 1-100, default is 25. | `30` | [optional] [default to 25]






### Return type

[**\ApiVideo\Client\Model\CaptionsListResponse**](../Model/CaptionsListResponse.md)

### Authorization

[bearerAuth](../../README.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## get()


Display a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a response indicating the caption was not found. Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions).

```php
get(string $videoId, string $language): \ApiVideo\Client\Model\Caption
```

### Arguments



Name | Type | Description  | Example | Notes
------------- | ------------- | ------------- | ------------- | -------------
 `videoId` | **string**| The unique identifier for the video you want captions for. | `vi4k0jvEUuaTdRAEjQ4Prklg` |
 `language` | **string**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation | `en` |




### Return type

[**\ApiVideo\Client\Model\Caption**](../Model/Caption.md)

### Authorization

[bearerAuth](../../README.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## update()


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

```php
update(string $videoId, string $language, \ApiVideo\Client\Model\CaptionsUpdatePayload $captionsUpdatePayload): \ApiVideo\Client\Model\Caption
```

### Arguments



Name | Type | Description  | Example | Notes
------------- | ------------- | ------------- | ------------- | -------------
 `videoId` | **string**| The unique identifier for the video you want to have automatic captions for. | `vi4k0jvEUuaTdRAEjQ4Prklg` |
 `language` | **string**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. | `en` |
 `captionsUpdatePayload` | [**\ApiVideo\Client\Model\CaptionsUpdatePayload**](../Model/CaptionsUpdatePayload.md)|  | `new \ApiVideo\Client\Model\CaptionsUpdatePayload()` |




### Return type

[**\ApiVideo\Client\Model\Caption**](../Model/Caption.md)

### Authorization

[bearerAuth](../../README.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## upload()


Upload a VTT file to add captions to your video.  Read our [captioning tutorial](https://api.video/blog/tutorials/adding-captions) for more details.

```php
upload(string $videoId, string $language, \SplFileObject $file): \ApiVideo\Client\Model\Caption
```

### Arguments



Name | Type | Description  | Example | Notes
------------- | ------------- | ------------- | ------------- | -------------
 `videoId` | **string**| The unique identifier for the video you want to add a caption to. | `vi4k0jvEUuaTdRAEjQ4Prklg` |
 `language` | **string**| A valid BCP 47 language representation. | `en` |
 `file` | **\SplFileObject**| The video text track (VTT) you want to upload. | `new \SplFileObject('path')` |




### Return type

[**\ApiVideo\Client\Model\Caption**](../Model/Caption.md)

### Authorization

[bearerAuth](../../README.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
