Manage audio tracks
Get the audio tracks of a video
GET https://api.video.ibm.com/videos/{videoId}/audio/tracks.json
Success response
Upon success a response with HTTP status “200 OK” is returned with the following key-value pairs under a tracks
element.
KEY | TYPE | DESCRIPTION |
---|---|---|
language | string | Language |
country | string | Country |
streamId | int | Stream ID |
default | boolean | Default |
disabled | boolean | Disabled |
Example of a success response:
{"tracks": [{"language": "en","country": "US","streamId": 12,"default": false,"disabled": false},
Error responses
Possible error responses:
HTTP RESPONSE CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
404 Not Found | not_found | Video does not exist |
503 Service Unavailable | There is a temporary error on the server which makes it impossible to serve the request |
Get available audio languages
GET https://api.video.ibm.com/videos/audio/languages.json
Success response
Upon success a response with HTTP status “200 OK” is returned with the following key-value pairs.
KEY | TYPE | DESCRIPTION |
---|---|---|
watson_supported | object | Languages supported by IBM Watson® Speech to Text Service |
other | object |
Error responses
Possible error responses:
HTTP RESPONSE CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
503 Service Unavailable | There is a temporary error on the server which makes it impossible to serve the request |
Set audio track language
PUT https://api.video.ibm.com/videos/{videoId}/audio/{streamId}/language.json
Parameters
KEY | TYPE | IMPORTANCE | DESCRIPTION |
---|---|---|---|
language | string | REQUIRED | One of the keys from Get available audio languages |
The Content-Type of the request should be application/x-www-form-urlencoded.
Example of the request:
POST /videos/1234/audio/12/language.json HTTP/1.1Host: api.video.ibm.comAuthorization: Bearer 3c2573673b782f6544405a22636f3d5d3b6f3950Content-Type: application/x-www-form-urlencodedlanguage=pt-BR
The token in the above call is only an example.
Success response
Upon success the response body is empty with an HTTP Status code of 204.
Error responses
Possible error responses:
HTTP RESPONSE CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
400 Bad Request | bad_request | Invalid language |
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
403 Unauthorized | lack_of_ownership | The provided access token could not access the given channel |
404 Not Found | not_found | Stream not found |
503 Service Unavailable | There is a temporary error on the server which makes it impossible to serve the request |
Get the default language of a video
GET https://api.video.ibm.com/videos/{videoId}/audio/default-language.json
Success response
Upon success a response with HTTP status “200 OK” is returned with the following key-value pairs.
KEY | TYPE | DESCRIPTION |
---|---|---|
language | string | Default language |
Example of a success response:
{"language": "es-00"}
Error responses
Possible error responses:
HTTP RESPONSE CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
403 Unauthorized | lack_of_ownership | The provided access token could not access the given channel |
404 Not Found | not_found | Video not found |
503 Service Unavailable | There is a temporary error on the server which makes it impossible to serve the request |
Set the default language of a video
PUT https://api.video.ibm.com/videos/{videoId}/audio/default-language.json
Parameters
KEY | TYPE | IMPORTANCE | DESCRIPTION |
---|---|---|---|
language | string | REQUIRED | One of the language and country pairs form Get the audio tracks of a video. See the example below. |
The Content-Type of the request should be application/x-www-form-urlencoded.
Example of the request:
POST /videos/1234/audio/default-language.json HTTP/1.1Host: api.video.ibm.comAuthorization: Bearer 3c2573673b782f6544405a22636f3d5d3b6f3950Content-Type: application/x-www-form-urlencodedlanguage=en-US
Success response
Upon success the response body is empty with an HTTP Status code of 204.
Error responses
Possible error responses:
HTTP RESPONSE CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
400 Bad Request | bad_request | Invalid language |
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
403 Unauthorized | lack_of_ownership | The provided access token could not access the given channel |
404 Not Found | not_found | Video not found |
503 Service Unavailable | There is a temporary error on the server which makes it impossible to serve the request |