curl -X POST "https://api-integration.ollang.com/integration/upload/vtt" \
-H "X-Api-Key: <your-api-key>" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/subtitles.vtt" \
-F "projectId=60b8d6f1e1b9b1d8c6c0d8e1" \
-F "name=sample_subtitles"
const formData = new FormData();
formData.append("file", vttFile);
formData.append("projectId", "60b8d6f1e1b9b1d8c6c0d8e1");
formData.append("name", "sample_subtitles");
const response = await fetch(
"https://api-integration.ollang.com/integration/upload/vtt",
{
method: "POST",
headers: {
"X-Api-Key": "<your-api-key>",
},
body: formData,
},
);
import requests
files = {'file': open('path/to/your/subtitles.vtt', 'rb')}
data = {
'projectId': '60b8d6f1e1b9b1d8c6c0d8e1',
'name': 'sample_subtitles'
}
headers = {'X-Api-Key': '<your-api-key>'}
response = requests.post(
'https://api-integration.ollang.com/integration/upload/vtt',
files=files,
data=data,
headers=headers
)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-integration.ollang.com/integration/upload/vtt',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'X-Api-Key: <your-api-key>'
),
CURLOPT_POSTFIELDS => array(
'file' => new CURLFile('path/to/your/subtitles.vtt'),
'projectId' => '60b8d6f1e1b9b1d8c6c0d8e1',
'name' => 'sample_subtitles'
),
));
$response = curl_exec($curl);
curl_close($curl);
package main
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
file, _ := os.Open("path/to/your/subtitles.vtt")
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, _ := writer.CreateFormFile("file", "subtitles.vtt")
io.Copy(part, file)
writer.WriteField("projectId", "60b8d6f1e1b9b1d8c6c0d8e1")
writer.WriteField("name", "sample_subtitles")
writer.Close()
req, _ := http.NewRequest("POST", "https://api-integration.ollang.com/integration/upload/vtt", body)
req.Header.Set("X-Api-Key", "<your-api-key>")
req.Header.Set("Content-Type", writer.FormDataContentType())
client := &http.Client{}
resp, _ := client.Do(req)
}
HttpResponse<String> response = Unirest.post("https://api-integration.ollang.com/integration/upload/vtt")
.header("X-Api-Key", "<your-api-key>")
.field("file", new File("path/to/your/subtitles.vtt"))
.field("projectId", "60b8d6f1e1b9b1d8c6c0d8e1")
.field("name", "sample_subtitles")
.asString();
{
"projectId": "60b8d6f1e1b9b1d8c6c0d8e1"
}
{
"error": "Invalid file format",
"message": "Only VTT files are supported",
"code": "INVALID_FILE_FORMAT"
}
{
"error": "Project not found",
"message": "No project found with the provided projectId",
"code": "PROJECT_NOT_FOUND"
}
{
"error": "File too large",
"message": "Maximum file size is 1GB",
"code": "FILE_TOO_LARGE"
}
{
"error": "Unauthorized",
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}
Ollang API Reference
Upload VTT File
Upload VTT subtitle files to associate with existing video projects
POST
/
integration
/
upload
/
vtt
curl -X POST "https://api-integration.ollang.com/integration/upload/vtt" \
-H "X-Api-Key: <your-api-key>" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/subtitles.vtt" \
-F "projectId=60b8d6f1e1b9b1d8c6c0d8e1" \
-F "name=sample_subtitles"
const formData = new FormData();
formData.append("file", vttFile);
formData.append("projectId", "60b8d6f1e1b9b1d8c6c0d8e1");
formData.append("name", "sample_subtitles");
const response = await fetch(
"https://api-integration.ollang.com/integration/upload/vtt",
{
method: "POST",
headers: {
"X-Api-Key": "<your-api-key>",
},
body: formData,
},
);
import requests
files = {'file': open('path/to/your/subtitles.vtt', 'rb')}
data = {
'projectId': '60b8d6f1e1b9b1d8c6c0d8e1',
'name': 'sample_subtitles'
}
headers = {'X-Api-Key': '<your-api-key>'}
response = requests.post(
'https://api-integration.ollang.com/integration/upload/vtt',
files=files,
data=data,
headers=headers
)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-integration.ollang.com/integration/upload/vtt',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'X-Api-Key: <your-api-key>'
),
CURLOPT_POSTFIELDS => array(
'file' => new CURLFile('path/to/your/subtitles.vtt'),
'projectId' => '60b8d6f1e1b9b1d8c6c0d8e1',
'name' => 'sample_subtitles'
),
));
$response = curl_exec($curl);
curl_close($curl);
package main
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
file, _ := os.Open("path/to/your/subtitles.vtt")
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, _ := writer.CreateFormFile("file", "subtitles.vtt")
io.Copy(part, file)
writer.WriteField("projectId", "60b8d6f1e1b9b1d8c6c0d8e1")
writer.WriteField("name", "sample_subtitles")
writer.Close()
req, _ := http.NewRequest("POST", "https://api-integration.ollang.com/integration/upload/vtt", body)
req.Header.Set("X-Api-Key", "<your-api-key>")
req.Header.Set("Content-Type", writer.FormDataContentType())
client := &http.Client{}
resp, _ := client.Do(req)
}
HttpResponse<String> response = Unirest.post("https://api-integration.ollang.com/integration/upload/vtt")
.header("X-Api-Key", "<your-api-key>")
.field("file", new File("path/to/your/subtitles.vtt"))
.field("projectId", "60b8d6f1e1b9b1d8c6c0d8e1")
.field("name", "sample_subtitles")
.asString();
{
"projectId": "60b8d6f1e1b9b1d8c6c0d8e1"
}
{
"error": "Invalid file format",
"message": "Only VTT files are supported",
"code": "INVALID_FILE_FORMAT"
}
{
"error": "Project not found",
"message": "No project found with the provided projectId",
"code": "PROJECT_NOT_FOUND"
}
{
"error": "File too large",
"message": "Maximum file size is 1GB",
"code": "FILE_TOO_LARGE"
}
{
"error": "Unauthorized",
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}
Upload VTT (WebVTT) subtitle files to associate with your existing video projects for enhanced accessibility and translation workflows.
curl -X POST "https://api-integration.ollang.com/integration/upload/vtt" \
-H "X-Api-Key: <your-api-key>" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/subtitles.vtt" \
-F "projectId=60b8d6f1e1b9b1d8c6c0d8e1" \
-F "name=sample_subtitles"
const formData = new FormData();
formData.append("file", vttFile);
formData.append("projectId", "60b8d6f1e1b9b1d8c6c0d8e1");
formData.append("name", "sample_subtitles");
const response = await fetch(
"https://api-integration.ollang.com/integration/upload/vtt",
{
method: "POST",
headers: {
"X-Api-Key": "<your-api-key>",
},
body: formData,
},
);
import requests
files = {'file': open('path/to/your/subtitles.vtt', 'rb')}
data = {
'projectId': '60b8d6f1e1b9b1d8c6c0d8e1',
'name': 'sample_subtitles'
}
headers = {'X-Api-Key': '<your-api-key>'}
response = requests.post(
'https://api-integration.ollang.com/integration/upload/vtt',
files=files,
data=data,
headers=headers
)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-integration.ollang.com/integration/upload/vtt',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'X-Api-Key: <your-api-key>'
),
CURLOPT_POSTFIELDS => array(
'file' => new CURLFile('path/to/your/subtitles.vtt'),
'projectId' => '60b8d6f1e1b9b1d8c6c0d8e1',
'name' => 'sample_subtitles'
),
));
$response = curl_exec($curl);
curl_close($curl);
package main
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
file, _ := os.Open("path/to/your/subtitles.vtt")
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, _ := writer.CreateFormFile("file", "subtitles.vtt")
io.Copy(part, file)
writer.WriteField("projectId", "60b8d6f1e1b9b1d8c6c0d8e1")
writer.WriteField("name", "sample_subtitles")
writer.Close()
req, _ := http.NewRequest("POST", "https://api-integration.ollang.com/integration/upload/vtt", body)
req.Header.Set("X-Api-Key", "<your-api-key>")
req.Header.Set("Content-Type", writer.FormDataContentType())
client := &http.Client{}
resp, _ := client.Do(req)
}
HttpResponse<String> response = Unirest.post("https://api-integration.ollang.com/integration/upload/vtt")
.header("X-Api-Key", "<your-api-key>")
.field("file", new File("path/to/your/subtitles.vtt"))
.field("projectId", "60b8d6f1e1b9b1d8c6c0d8e1")
.field("name", "sample_subtitles")
.asString();
Authorizations
This endpoint requires API key authentication. Include your API key in the request header:- Header name:
X-Api-Key - Header value: Your API key from the Ollang dashboard
- Format:
X-Api-Key: your-api-key-here
Body Parameters
file
required
The VTT (WebVTT) subtitle file to upload. Only .vtt format is supported.
Maximum file size: 1GB. Note: For testing in the API playground, the upload
limit is 5MB.
string
required
Unique identifier for the project to associate this VTT file with. This should
be an existing project ID from a previous video upload.
string
required
Name of the file being uploaded. This will be used as the identifier for your
uploaded subtitle content.
string
The source language of the content in the uploaded file. Use one of the codes
listed in Supported Languages.
The special value
all is also accepted for auto-detection workflows.Response
string
Unique identifier for the project associated with the uploaded VTT file. This
confirms the successful association of the subtitle file with the project.
{
"projectId": "60b8d6f1e1b9b1d8c6c0d8e1"
}
{
"error": "Invalid file format",
"message": "Only VTT files are supported",
"code": "INVALID_FILE_FORMAT"
}
{
"error": "Project not found",
"message": "No project found with the provided projectId",
"code": "PROJECT_NOT_FOUND"
}
{
"error": "File too large",
"message": "Maximum file size is 1GB",
"code": "FILE_TOO_LARGE"
}
{
"error": "Unauthorized",
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}
Was this page helpful?
⌘I