📊 Batch Create Custom Glossary (Upload CSV)
This API allows you to upload a glossary file in CSV format. Each row in the file represents a glossary term mapping between source and target language.
📋 Basic Information
- Method:
POST - Path:
https://api.bluente.com/api/20250924/blu_translate/glossary/upload - Authentication: Required —
Authorization: Bearer $BLUENTE_API_KEY
📝 Request Parameters (Query)
Query String: none
Request Body
- Type:
multipart/form-data
{
"file": file.csv, // must follow the template file's format
"namespace": "Bluente Partner" // scope for a specific client or project
}| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | CSV file to upload |
namespace | string | No | Namespace for the glossary |
📎 CSV Template: Download here
The CSV file must contain the required columns:
source_langsource_texttarget_langtarget_text
💡 Example
curl -X POST "https://api.bluente.com/api/20250924/blu_translate/glossary/upload" \
-H "Authorization: Bearer $BLUENTE_API_KEY" \
-F "file=@custom_glossary.csv" \
-F "namespace=Bluente Partner"or
fetch("https://api.bluente.com/api/20250924/blu_translate/glossary/upload", {
method: "POST",
headers: {
"Authorization": "Bearer $BLUENTE_API_KEY"
},
body: {
file: "/path/to/custom_glossary.csv",
namespace: "Bluente Partner"
}
})✅ Success Response Example
{
"message": "success",
"code": 0,
"data": [
{
"id": 238,
"user_id": "",
"organization_id": "",
"source_lang": "English",
"source_text": "hello",
"target_lang": "Chinese",
"target_text": "你好",
"namespace": "Bluente Partner",
"app_id": 10000,
"updated_by": "",
"updated_at": "2024-11-18 16:00:54",
"created_at": "2024-11-18 16:00:54"
},
{
"id": 239,
"user_id": "",
"organization_id": "",
"source_lang": "English",
"source_text": "Hi",
"target_lang": "Chinese",
"target_text": "你好啊",
"namespace": "Bluente Partner",
"app_id": 10000,
"updated_by": "",
"updated_at": "2024-11-18 16:01:14",
"created_at": "2024-11-18 16:01:14"
}
]
}📊 Response Fields
| Field | Type | Description |
|---|---|---|
message | string | Response message, usually "success" |
code | int | Status code, 0 means success |
data | array | List of glossary entries created |
data[].id | int | Glossary item ID |
data[].user_id | string | ID of the user who created the glossary |
data[].organization_id | string | Organization ID (empty if not set) |
data[].source_lang | string | Source language name |
data[].source_text | string | Source term text |
data[].target_lang | string | Target language name |
data[].target_text | string | Target term text |
data[].namespace | string | Namespace (scope of glossary) |
data[].app_id | int | Application ID |
data[].updated_by | string | Last updater (empty if none) |
data[].updated_at | string | Last update timestamp |
data[].created_at | string | Creation timestamp |
❌ Error Response Example
{
"message": "invalid file format",
"code": 400
}📌 Notes
- The CSV file must strictly follow the template format; otherwise, the API will reject the upload.
namespaceallows isolating glossaries for different clients, partners, or use cases.- Each successful row in the CSV will be returned in the
dataarray with its generatedid. - Uploading a large glossary may take longer to process.