Skip to content

Commit

Permalink
Add samples
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo committed Mar 30, 2022
1 parent 7dd2ff5 commit 8b51e4d
Show file tree
Hide file tree
Showing 18 changed files with 1,944 additions and 1,946 deletions.
112 changes: 56 additions & 56 deletions README.md
Expand Up @@ -91,103 +91,103 @@ const ApiVideoClient = require('@api.video/nodejs-client');

### CaptionsApi

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


### ChaptersApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**delete()**](doc/api/ChaptersApi.md#delete) | **DELETE** /videos/{videoId}/chapters/{language} | Delete a chapter
[**list()**](doc/api/ChaptersApi.md#list) | **GET** /videos/{videoId}/chapters | List video chapters
[**get()**](doc/api/ChaptersApi.md#get) | **GET** /videos/{videoId}/chapters/{language} | Retrieve a chapter
[**upload()**](doc/api/ChaptersApi.md#upload) | **POST** /videos/{videoId}/chapters/{language} | Upload a chapter
[**upload()**](doc/api/ChaptersApi.md#upload) | Upload a chapter | **POST** /videos/{videoId}/chapters/{language}
[**get()**](doc/api/ChaptersApi.md#get) | Retrieve a chapter | **GET** /videos/{videoId}/chapters/{language}
[**delete()**](doc/api/ChaptersApi.md#delete) | Delete a chapter | **DELETE** /videos/{videoId}/chapters/{language}
[**list()**](doc/api/ChaptersApi.md#list) | List video chapters | **GET** /videos/{videoId}/chapters


### LiveStreamsApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**delete()**](doc/api/LiveStreamsApi.md#delete) | **DELETE** /live-streams/{liveStreamId} | Delete a live stream
[**deleteThumbnail()**](doc/api/LiveStreamsApi.md#deleteThumbnail) | **DELETE** /live-streams/{liveStreamId}/thumbnail | Delete a thumbnail
[**list()**](doc/api/LiveStreamsApi.md#list) | **GET** /live-streams | List all live streams
[**get()**](doc/api/LiveStreamsApi.md#get) | **GET** /live-streams/{liveStreamId} | Retrieve live stream
[**update()**](doc/api/LiveStreamsApi.md#update) | **PATCH** /live-streams/{liveStreamId} | Update a live stream
[**create()**](doc/api/LiveStreamsApi.md#create) | **POST** /live-streams | Create live stream
[**uploadThumbnail()**](doc/api/LiveStreamsApi.md#uploadThumbnail) | **POST** /live-streams/{liveStreamId}/thumbnail | Upload a thumbnail
[**create()**](doc/api/LiveStreamsApi.md#create) | Create live stream | **POST** /live-streams
[**get()**](doc/api/LiveStreamsApi.md#get) | Retrieve live stream | **GET** /live-streams/{liveStreamId}
[**update()**](doc/api/LiveStreamsApi.md#update) | Update a live stream | **PATCH** /live-streams/{liveStreamId}
[**delete()**](doc/api/LiveStreamsApi.md#delete) | Delete a live stream | **DELETE** /live-streams/{liveStreamId}
[**list()**](doc/api/LiveStreamsApi.md#list) | List all live streams | **GET** /live-streams
[**uploadThumbnail()**](doc/api/LiveStreamsApi.md#uploadThumbnail) | Upload a thumbnail | **POST** /live-streams/{liveStreamId}/thumbnail
[**deleteThumbnail()**](doc/api/LiveStreamsApi.md#deleteThumbnail) | Delete a thumbnail | **DELETE** /live-streams/{liveStreamId}/thumbnail


### PlayerThemesApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**delete()**](doc/api/PlayerThemesApi.md#delete) | **DELETE** /players/{playerId} | Delete a player
[**deleteLogo()**](doc/api/PlayerThemesApi.md#deleteLogo) | **DELETE** /players/{playerId}/logo | Delete logo
[**list()**](doc/api/PlayerThemesApi.md#list) | **GET** /players | List all player themes
[**get()**](doc/api/PlayerThemesApi.md#get) | **GET** /players/{playerId} | Retrieve a player
[**update()**](doc/api/PlayerThemesApi.md#update) | **PATCH** /players/{playerId} | Update a player
[**create()**](doc/api/PlayerThemesApi.md#create) | **POST** /players | Create a player
[**uploadLogo()**](doc/api/PlayerThemesApi.md#uploadLogo) | **POST** /players/{playerId}/logo | Upload a logo
[**create()**](doc/api/PlayerThemesApi.md#create) | Create a player | **POST** /players
[**get()**](doc/api/PlayerThemesApi.md#get) | Retrieve a player | **GET** /players/{playerId}
[**update()**](doc/api/PlayerThemesApi.md#update) | Update a player | **PATCH** /players/{playerId}
[**delete()**](doc/api/PlayerThemesApi.md#delete) | Delete a player | **DELETE** /players/{playerId}
[**list()**](doc/api/PlayerThemesApi.md#list) | List all player themes | **GET** /players
[**uploadLogo()**](doc/api/PlayerThemesApi.md#uploadLogo) | Upload a logo | **POST** /players/{playerId}/logo
[**deleteLogo()**](doc/api/PlayerThemesApi.md#deleteLogo) | Delete logo | **DELETE** /players/{playerId}/logo


### RawStatisticsApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**listLiveStreamSessions()**](doc/api/RawStatisticsApi.md#listLiveStreamSessions) | **GET** /analytics/live-streams/{liveStreamId} | List live stream player sessions
[**listSessionEvents()**](doc/api/RawStatisticsApi.md#listSessionEvents) | **GET** /analytics/sessions/{sessionId}/events | List player session events
[**listVideoSessions()**](doc/api/RawStatisticsApi.md#listVideoSessions) | **GET** /analytics/videos/{videoId} | List video player sessions
[**listLiveStreamSessions()**](doc/api/RawStatisticsApi.md#listLiveStreamSessions) | List live stream player sessions | **GET** /analytics/live-streams/{liveStreamId}
[**listSessionEvents()**](doc/api/RawStatisticsApi.md#listSessionEvents) | List player session events | **GET** /analytics/sessions/{sessionId}/events
[**listVideoSessions()**](doc/api/RawStatisticsApi.md#listVideoSessions) | List video player sessions | **GET** /analytics/videos/{videoId}


### UploadTokensApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**deleteToken()**](doc/api/UploadTokensApi.md#deleteToken) | **DELETE** /upload-tokens/{uploadToken} | Delete an upload token
[**list()**](doc/api/UploadTokensApi.md#list) | **GET** /upload-tokens | List all active upload tokens.
[**getToken()**](doc/api/UploadTokensApi.md#getToken) | **GET** /upload-tokens/{uploadToken} | Retrieve upload token
[**createToken()**](doc/api/UploadTokensApi.md#createToken) | **POST** /upload-tokens | Generate an upload token
[**createToken()**](doc/api/UploadTokensApi.md#createToken) | Generate an upload token | **POST** /upload-tokens
[**getToken()**](doc/api/UploadTokensApi.md#getToken) | Retrieve upload token | **GET** /upload-tokens/{uploadToken}
[**deleteToken()**](doc/api/UploadTokensApi.md#deleteToken) | Delete an upload token | **DELETE** /upload-tokens/{uploadToken}
[**list()**](doc/api/UploadTokensApi.md#list) | List all active upload tokens. | **GET** /upload-tokens


### VideosApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**delete()**](doc/api/VideosApi.md#delete) | **DELETE** /videos/{videoId} | Delete a video
[**get()**](doc/api/VideosApi.md#get) | **GET** /videos/{videoId} | Retrieve a video
[**getStatus()**](doc/api/VideosApi.md#getStatus) | **GET** /videos/{videoId}/status | Retrieve video status
[**list()**](doc/api/VideosApi.md#list) | **GET** /videos | List all videos
[**update()**](doc/api/VideosApi.md#update) | **PATCH** /videos/{videoId} | Update a video
[**pickThumbnail()**](doc/api/VideosApi.md#pickThumbnail) | **PATCH** /videos/{videoId}/thumbnail | Pick a thumbnail
[**uploadWithUploadToken()**](doc/api/VideosApi.md#uploadWithUploadToken) | **POST** /upload | Upload with an upload token
[**create()**](doc/api/VideosApi.md#create) | **POST** /videos | Create a video
[**upload()**](doc/api/VideosApi.md#upload) | **POST** /videos/{videoId}/source | Upload a video
[**uploadThumbnail()**](doc/api/VideosApi.md#uploadThumbnail) | **POST** /videos/{videoId}/thumbnail | Upload a thumbnail
[**create()**](doc/api/VideosApi.md#create) | Create a video | **POST** /videos
[**upload()**](doc/api/VideosApi.md#upload) | Upload a video | **POST** /videos/{videoId}/source
[**uploadWithUploadToken()**](doc/api/VideosApi.md#uploadWithUploadToken) | Upload with an upload token | **POST** /upload
[**get()**](doc/api/VideosApi.md#get) | Retrieve a video | **GET** /videos/{videoId}
[**update()**](doc/api/VideosApi.md#update) | Update a video | **PATCH** /videos/{videoId}
[**delete()**](doc/api/VideosApi.md#delete) | Delete a video | **DELETE** /videos/{videoId}
[**list()**](doc/api/VideosApi.md#list) | List all videos | **GET** /videos
[**uploadThumbnail()**](doc/api/VideosApi.md#uploadThumbnail) | Upload a thumbnail | **POST** /videos/{videoId}/thumbnail
[**pickThumbnail()**](doc/api/VideosApi.md#pickThumbnail) | Pick a thumbnail | **PATCH** /videos/{videoId}/thumbnail
[**getStatus()**](doc/api/VideosApi.md#getStatus) | Retrieve video status | **GET** /videos/{videoId}/status


### WatermarksApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**delete()**](doc/api/WatermarksApi.md#delete) | **DELETE** /watermarks/{watermarkId} | Delete a watermark
[**list()**](doc/api/WatermarksApi.md#list) | **GET** /watermarks | List all watermarks
[**upload()**](doc/api/WatermarksApi.md#upload) | **POST** /watermarks | Upload a watermark
[**upload()**](doc/api/WatermarksApi.md#upload) | Upload a watermark | **POST** /watermarks
[**delete()**](doc/api/WatermarksApi.md#delete) | Delete a watermark | **DELETE** /watermarks/{watermarkId}
[**list()**](doc/api/WatermarksApi.md#list) | List all watermarks | **GET** /watermarks


### WebhooksApi

Method | HTTP request | Description
Method | Description | HTTP request
------------- | ------------- | -------------
[**delete()**](doc/api/WebhooksApi.md#delete) | **DELETE** /webhooks/{webhookId} | Delete a Webhook
[**get()**](doc/api/WebhooksApi.md#get) | **GET** /webhooks/{webhookId} | Retrieve Webhook details
[**list()**](doc/api/WebhooksApi.md#list) | **GET** /webhooks | List all webhooks
[**create()**](doc/api/WebhooksApi.md#create) | **POST** /webhooks | Create Webhook
[**create()**](doc/api/WebhooksApi.md#create) | Create Webhook | **POST** /webhooks
[**get()**](doc/api/WebhooksApi.md#get) | Retrieve Webhook details | **GET** /webhooks/{webhookId}
[**delete()**](doc/api/WebhooksApi.md#delete) | Delete a Webhook | **DELETE** /webhooks/{webhookId}
[**list()**](doc/api/WebhooksApi.md#list) | List all webhooks | **GET** /webhooks



Expand Down
120 changes: 60 additions & 60 deletions doc/api/CaptionsApi.md
Expand Up @@ -4,75 +4,44 @@ All URIs are relative to *https://ws.api.video*

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


<a name="delete"></a>
## **`delete()` - Delete a caption**


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.

### 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 [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. |


### Return type

Promise<[**void**](../model/.md)>.


### Example
```js
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklgc'; // The unique identifier for the video you want to delete a caption from.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.

await client.captions.delete(videoId, language);

```
| [**delete()**](CaptionsApi.md#delete) | Delete a caption | **DELETE** /videos/{videoId}/captions/{language} |
| [**list()**](CaptionsApi.md#list) | List video captions | **GET** /videos/{videoId}/captions |


---
<a name="upload"></a>
## **`upload()` - Upload a caption**

<a name="list"></a>
## **`list()` - List video captions**

Upload a VTT file to add captions to your video.

Retrieve a list of available captions for the videoId you provide.
Read our [captioning tutorial](https://api.video/blog/tutorials/adding-captions) for more details.

### 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. |
| **videoId** | **string**| **yes**| The unique identifier for the video you want to add a caption to. |
| **language** | **string**| **yes**| A valid BCP 47 language representation. |
| **file** | **string**| **yes**| The video text track (VTT) you want to upload. |


### Return type

Promise<[**CaptionsListResponse**](../model/CaptionsListResponse.md)>.
Promise<[**Caption**](../model/Caption.md)>.


### Example
```js
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const captions = await client.captions.list({
videoId 'vi4k0jvEUuaTdRAEjQ4Prklg', // The unique identifier for the video you want to retrieve a list of captions for.
currentPage: 2, // Choose the number of search results to return per page. Minimum value: 1
pageSize: 30, // Results per page. Allowed values 1-100, default is 25.
);
const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to add a caption to.
const language = 'en'; // A valid BCP 47 language representation.
const file = './en.vtt'; // The video text track (VTT) you want to upload.

const caption = await client.captions.upload(videoId, language, file);
```


Expand Down Expand Up @@ -149,37 +118,68 @@ const caption = await client.captions.update(videoId, language, captionsUpdatePa

---

<a name="upload"></a>
## **`upload()` - Upload a caption**
<a name="delete"></a>
## **`delete()` - Delete a caption**


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

### 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 BCP 47 language representation. |
| **file** | **string**| **yes**| The video text track (VTT) you want to upload. |
| **videoId** | **string**| **yes**| The unique identifier for the video you want to delete a caption from. |
| **language** | **string**| **yes**| A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation. |


### Return type

Promise<[**Caption**](../model/Caption.md)>.
Promise<[**void**](../model/.md)>.


### Example
```js
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to add a caption to.
const language = 'en'; // A valid BCP 47 language representation.
const file = './en.vtt'; // The video text track (VTT) you want to upload.
const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklgc'; // The unique identifier for the video you want to delete a caption from.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.

const caption = await client.captions.upload(videoId, language, file);
await client.captions.delete(videoId, language);

```


---

<a name="list"></a>
## **`list()` - List video captions**


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

### 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**](../model/CaptionsListResponse.md)>.


### Example
```js
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const captions = await client.captions.list({
videoId 'vi4k0jvEUuaTdRAEjQ4Prklg', // The unique identifier for the video you want to retrieve a list of captions for.
currentPage: 2, // Choose the number of search results to return per page. Minimum value: 1
pageSize: 30, // Results per page. Allowed values 1-100, default is 25.
);
```
Expand Down

0 comments on commit 8b51e4d

Please sign in to comment.