Upload a File
Changed onCreate a Document from a file in any of the formats documented in our knowledge base. Request parameters should be passed as JSON object with the header field LILT-API.
File names in the header can only contain US-ASCII characters. File names with characters outside of US-ASCII should be URI encoded or transliterated to US-ASCII strings.
Example CURL command:
curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \
--header "LILT-API: {\"name\": \"introduction.xliff\",\"pretranslate\": \"tm+mt\",\"project_id\": 9}" \
--header "Content-Type: application/octet-stream" \
--data-binary @Introduction.xliff
Request
- Base URLhttps://api.lilt.com
- URLhttps://api.lilt.com/v2/documents/files
- AuthHTTP basic
Headers
A file name.
A unique Project identifier.
An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are TM, or TM+MT
An optional parameter to auto-accept segments with 100% translation memory matches when the pretranslate option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for Accept and lock exact matches, if set to false, no segments will be auto-accepted.
An optional parameter to use case sensitive translation memory matching when the pretranslate option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for Use case sensitive translation memory matching setting
An optional parameter to attribute translation authorship of exact matches to the author of the file when the pretranslate option is also enabled. Default value matches your organization settings for Translation authorship setting
An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
Request body application/octet-stream
Example request
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<xliff xmlns=\"urn:oasis:names:tc:xliff:document:1.2\">\n...\n</xliff>"
Response
A Document object.
Example response
{
"id": 46530,
"project_id": 287,
"srclang": "en",
"trglang": "de",
"name": "Introduction.xliff",
"import_error_message": "Could not parse XML.",
"export_error_message": "Could not parse XML.",
"status": {
"pretranslation": "idle"
},
"translator_email": "translator@example.com",
"reviewer_email": "reviewer@example.com",
"created_at": 1489147692,
"updated_at": 1489147692,
"is_review_complete": true,
"segments": [
{
"id": 84480010,
"created_at": 1489147692,
"updated_at": 1489147692,
"document_id": 1234,
"memory_id": 5678,
"source": "The red bus.",
"srclang": "en",
"target": "Le bus rouge.",
"trglang": "fr",
"is_confirmed": true,
"is_reviewed": true
}
]
}Changes
- breaking
added the new required
headerrequest parametername - breaking
added the new required
headerrequest parameterproject_id - breaking
added required request body
- info
api operation id
uploadDocumentwas added - info
added the new optional
headerrequest parameterauto_accept - info
added the new optional
headerrequest parametercase_sensitive - info
added the new optional
headerrequest parameterconfig_id - info
added the new optional
headerrequest parametermatch_attribution - info
added the new optional
headerrequest parameterpretranslate - info
added the non-success response with the status
- info
added the success response with the status
- breaking