curl -X POST "https://api-integration.ollang.com/integration/upload/direct" \
-H "X-Api-Key: <your-api-key>" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/document.pdf" \
-F "name=contract_document" \
-F "sourceLanguage=en" \
-F "folderId=60b8d6f1e1b9b1d8c6c0d8e2"
const formData = new FormData();
formData.append("file", fileToUpload); // Can be any supported file type
formData.append("name", "contract_document");
formData.append("sourceLanguage", "en");
formData.append("folderId", "60b8d6f1e1b9b1d8c6c0d8e2");
const response = await fetch(
"https://api-integration.ollang.com/integration/upload/direct",
{
method: "POST",
headers: {
"X-Api-Key": "<your-api-key>",
},
body: formData,
},
);
import requests
files = {'file': open('path/to/your/document.pdf', 'rb')} # Any supported file type
data = {
'name': 'contract_document',
'sourceLanguage': 'en',
'folderId': '60b8d6f1e1b9b1d8c6c0d8e2'
}
headers = {'X-Api-Key': '<your-api-key>'}
response = requests.post(
'https://api-integration.ollang.com/integration/upload/direct',
files=files,
data=data,
headers=headers
)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-integration.ollang.com/integration/upload/direct',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'X-Api-Key: <your-api-key>'
),
CURLOPT_POSTFIELDS => array(
'file' => new CURLFile('path/to/your/document.pdf'), // Any supported file type
'name' => 'contract_document',
'sourceLanguage' => 'en',
'folderId' => '60b8d6f1e1b9b1d8c6c0d8e2'
),
));
$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/document.pdf") // Any supported file type
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, _ := writer.CreateFormFile("file", "document.pdf")
io.Copy(part, file)
writer.WriteField("name", "contract_document")
writer.WriteField("sourceLanguage", "en")
writer.WriteField("folderId", "60b8d6f1e1b9b1d8c6c0d8e2")
writer.Close()
req, _ := http.NewRequest("POST", "https://api-integration.ollang.com/integration/upload/direct", 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/direct")
.header("X-Api-Key", "<your-api-key>")
.field("file", new File("path/to/your/document.pdf")) // Any supported file type
.field("name", "contract_document")
.field("sourceLanguage", "en")
.field("folderId", "60b8d6f1e1b9b1d8c6c0d8e2")
.asString();
{
"projectId": "60b8d6f1e1b9b1d8c6c0d8e1"
}
{
"code": 40001,
"error": "UnsupportedFileTypeException",
"message": "Unsupported file type",
"data": "{\"filename\":\"blob\",\"reason\":\"The uploaded file has no extension. Send the file under its real name.\"}"
}
{
"error": "File too large",
"message": "File exceeds maximum size limit. Video files: 30GB max, Document files: 100MB max",
"code": "FILE_TOO_LARGE"
}
{
"error": "Unauthorized",
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}
Ollang API Reference
Direct File Upload
Upload files directly to the platform for processing and translation services. Supports multiple file formats including MP4, MP3, DOCX, PDF, JPEG, PNG for Image to Image translation, and more
POST
/
integration
/
upload
/
direct
curl -X POST "https://api-integration.ollang.com/integration/upload/direct" \
-H "X-Api-Key: <your-api-key>" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/document.pdf" \
-F "name=contract_document" \
-F "sourceLanguage=en" \
-F "folderId=60b8d6f1e1b9b1d8c6c0d8e2"
const formData = new FormData();
formData.append("file", fileToUpload); // Can be any supported file type
formData.append("name", "contract_document");
formData.append("sourceLanguage", "en");
formData.append("folderId", "60b8d6f1e1b9b1d8c6c0d8e2");
const response = await fetch(
"https://api-integration.ollang.com/integration/upload/direct",
{
method: "POST",
headers: {
"X-Api-Key": "<your-api-key>",
},
body: formData,
},
);
import requests
files = {'file': open('path/to/your/document.pdf', 'rb')} # Any supported file type
data = {
'name': 'contract_document',
'sourceLanguage': 'en',
'folderId': '60b8d6f1e1b9b1d8c6c0d8e2'
}
headers = {'X-Api-Key': '<your-api-key>'}
response = requests.post(
'https://api-integration.ollang.com/integration/upload/direct',
files=files,
data=data,
headers=headers
)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-integration.ollang.com/integration/upload/direct',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'X-Api-Key: <your-api-key>'
),
CURLOPT_POSTFIELDS => array(
'file' => new CURLFile('path/to/your/document.pdf'), // Any supported file type
'name' => 'contract_document',
'sourceLanguage' => 'en',
'folderId' => '60b8d6f1e1b9b1d8c6c0d8e2'
),
));
$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/document.pdf") // Any supported file type
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, _ := writer.CreateFormFile("file", "document.pdf")
io.Copy(part, file)
writer.WriteField("name", "contract_document")
writer.WriteField("sourceLanguage", "en")
writer.WriteField("folderId", "60b8d6f1e1b9b1d8c6c0d8e2")
writer.Close()
req, _ := http.NewRequest("POST", "https://api-integration.ollang.com/integration/upload/direct", 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/direct")
.header("X-Api-Key", "<your-api-key>")
.field("file", new File("path/to/your/document.pdf")) // Any supported file type
.field("name", "contract_document")
.field("sourceLanguage", "en")
.field("folderId", "60b8d6f1e1b9b1d8c6c0d8e2")
.asString();
{
"projectId": "60b8d6f1e1b9b1d8c6c0d8e1"
}
{
"code": 40001,
"error": "UnsupportedFileTypeException",
"message": "Unsupported file type",
"data": "{\"filename\":\"blob\",\"reason\":\"The uploaded file has no extension. Send the file under its real name.\"}"
}
{
"error": "File too large",
"message": "File exceeds maximum size limit. Video files: 30GB max, Document files: 100MB max",
"code": "FILE_TOO_LARGE"
}
{
"error": "Unauthorized",
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}
Upload files directly to the platform by calling this endpoint to process your content for translation and transcription services. This endpoint accepts a wide variety of file formats including:
The three-argument
- Video files: MP4, AVI, MOV, WMV
- Audio files: MP3, WAV, AAC, M4A
- Document files: DOCX, PDF, TXT, RTF
- Presentation files: PPTX, PPT
- Spreadsheet files: XLSX, XLS
- Image to Image translation: JPEG, JPG, PNG (direct upload for image-based translation)
- And many more formats
curl -X POST "https://api-integration.ollang.com/integration/upload/direct" \
-H "X-Api-Key: <your-api-key>" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/document.pdf" \
-F "name=contract_document" \
-F "sourceLanguage=en" \
-F "folderId=60b8d6f1e1b9b1d8c6c0d8e2"
const formData = new FormData();
formData.append("file", fileToUpload); // Can be any supported file type
formData.append("name", "contract_document");
formData.append("sourceLanguage", "en");
formData.append("folderId", "60b8d6f1e1b9b1d8c6c0d8e2");
const response = await fetch(
"https://api-integration.ollang.com/integration/upload/direct",
{
method: "POST",
headers: {
"X-Api-Key": "<your-api-key>",
},
body: formData,
},
);
import requests
files = {'file': open('path/to/your/document.pdf', 'rb')} # Any supported file type
data = {
'name': 'contract_document',
'sourceLanguage': 'en',
'folderId': '60b8d6f1e1b9b1d8c6c0d8e2'
}
headers = {'X-Api-Key': '<your-api-key>'}
response = requests.post(
'https://api-integration.ollang.com/integration/upload/direct',
files=files,
data=data,
headers=headers
)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-integration.ollang.com/integration/upload/direct',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'X-Api-Key: <your-api-key>'
),
CURLOPT_POSTFIELDS => array(
'file' => new CURLFile('path/to/your/document.pdf'), // Any supported file type
'name' => 'contract_document',
'sourceLanguage' => 'en',
'folderId' => '60b8d6f1e1b9b1d8c6c0d8e2'
),
));
$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/document.pdf") // Any supported file type
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, _ := writer.CreateFormFile("file", "document.pdf")
io.Copy(part, file)
writer.WriteField("name", "contract_document")
writer.WriteField("sourceLanguage", "en")
writer.WriteField("folderId", "60b8d6f1e1b9b1d8c6c0d8e2")
writer.Close()
req, _ := http.NewRequest("POST", "https://api-integration.ollang.com/integration/upload/direct", 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/direct")
.header("X-Api-Key", "<your-api-key>")
.field("file", new File("path/to/your/document.pdf")) // Any supported file type
.field("name", "contract_document")
.field("sourceLanguage", "en")
.field("folderId", "60b8d6f1e1b9b1d8c6c0d8e2")
.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
The multipart filename matters
The stored file’s extension comes from thefilename of the multipart file
part, not from the name field. A part sent without a filename is rejected
with 400 Unsupported file type, as is one whose extension the platform cannot
process — before the project is created, so a rejected upload leaves nothing
behind.
Most HTTP clients set the filename from the file you hand them (curl -F file=@video.mp4, Python’s open(...), a JavaScript File). The exception is
a bare Blob in JavaScript, which has no name of its own — FormData then
defaults the filename to blob. Name it explicitly:
const formData = new FormData();
formData.append("file", new Blob([bytes]), "en.json");
formData.append("name", "App strings");
formData.append("sourceLanguage", "en");
append requires a Blob, so wrap raw bytes rather than
passing a Buffer or Uint8Array straight in — those throw TypeError: parameter 2 is not of type 'Blob'. A File carries the name itself, but it is
only a global from Node 20 onwards.
Body Parameters
file
required
The file to upload for translation. Supports a wide range of file formats
including: Video formats: MP4, AVI, MOV, WMV, FLV, MKV Audio formats:
MP3, WAV, AAC, M4A, FLAC, OGG Document formats: DOCX, DOC, PDF, TXT, RTF,
ODT Presentation formats: PPTX, PPT, ODP Spreadsheet formats: XLSX,
XLS, ODS, CSV Image formats (Image to Image translation): JPEG, JPG, PNG
Other formats: HTML, XML, JSON, SRT, VTT, IDML, DITA, DITAMAP, DITAVAL Maximum file size:
30GB for video files, 100MB for document files. Note: For testing in the API
playground, the upload limit is 5MB.
string
required
Name of the file being uploaded. This will be used as the identifier for your
uploaded content. Should be descriptive and unique for easy identification.It does not need an extension: the uploaded file’s extension is appended to
it unless
name already ends in that same extension.string
required
The source language of the file content. Use standard language codes such as:
- ‘en’ for English - ‘es’ for Spanish - ‘fr’ for French - ‘de’ for German - ‘zh’ for Chinese - ‘ja’ for Japanese - ‘tr’ for Turkish - And many more supported languages
array
Array of order notes for additional instructions or information about the upload.
Each entry is an order note object.
Example:
[{"details": "Please ignore the subtitles for 30 seconds", "timeStamp": "02:15:30"}]string
Optional folder ID to place the project in. The folder must belong to the same
client account. If not provided, the project will be placed in the default
“API Uploads” folder. You can retrieve available folder IDs using the
Retrieve All Folders
endpoint.Any folder-level documents on the target folder — guidelines, glossaries, and
character lists — are applied to the new project automatically, the same way
they are for projects created in the dashboard. See Attach Folder
Document.
Response
string
Unique identifier for the project associated with the uploaded file. Use this
ID to create, track, and manage your uploaded content throughout the
translation process.
{
"projectId": "60b8d6f1e1b9b1d8c6c0d8e1"
}
{
"code": 40001,
"error": "UnsupportedFileTypeException",
"message": "Unsupported file type",
"data": "{\"filename\":\"blob\",\"reason\":\"The uploaded file has no extension. Send the file under its real name.\"}"
}
{
"error": "File too large",
"message": "File exceeds maximum size limit. Video files: 30GB max, Document files: 100MB max",
"code": "FILE_TOO_LARGE"
}
{
"error": "Unauthorized",
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}
Was this page helpful?