# Aimastering.VideoApi
All URIs are relative to *https://api.bakuage.com:443*
Method | HTTP request | Description
------------- | ------------- | -------------
[**downloadVideo**](VideoApi.md#downloadVideo) | **GET** /videos/{id}/download | Download an video data by id.
[**downloadVideoByToken**](VideoApi.md#downloadVideoByToken) | **GET** /videos/download_by_token | Download an video data by video_download_token.
[**getVideo**](VideoApi.md#getVideo) | **GET** /videos/{id} | Get an video by id.
[**getVideoDownloadToken**](VideoApi.md#getVideoDownloadToken) | **GET** /videos/{id}/download_token | Get an video download token by id.
[**listVideos**](VideoApi.md#listVideos) | **GET** /videos | Get all videos accessable.
# **downloadVideo**
> 'Blob' downloadVideo(id)
Download an video data by id.
### Example
```javascript
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.VideoApi();
var id = 56; // Number | Video id
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.downloadVideo(id, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Number**| Video id |
### Return type
**'Blob'**
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/octet-stream
# **downloadVideoByToken**
> 'Blob' downloadVideoByToken(downloadToken)
Download an video data by video_download_token.
### Example
```javascript
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.VideoApi();
var downloadToken = "downloadToken_example"; // String | Video download token
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.downloadVideoByToken(downloadToken, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**downloadToken** | **String**| Video download token |
### Return type
**'Blob'**
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/octet-stream
# **getVideo**
> Video getVideo(id)
Get an video by id.
### Example
```javascript
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.VideoApi();
var id = 56; // Number | Video id
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getVideo(id, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Number**| Video id |
### Return type
[**Video**](Video.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **getVideoDownloadToken**
> VideoDownloadToken getVideoDownloadToken(id)
Get an video download token by id.
### Example
```javascript
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.VideoApi();
var id = 56; // Number | Video id
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getVideoDownloadToken(id, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Number**| Video id |
### Return type
[**VideoDownloadToken**](VideoDownloadToken.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **listVideos**
> [Video] listVideos()
Get all videos accessable.
### Example
```javascript
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.VideoApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listVideos(callback);
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**[Video]**](Video.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json