Upload a File
Changed onUpload a File in any of the formats documented in our knowledge base. Request parameters should be passed in as query string parameters.
Example CURL command:
curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \
--header "Content-Type: application/octet-stream" \
--data-binary @en_US.json
Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score.
The language detection will complete asynchronously. Prior to completion, the detected_lang value will be zxx, the reserved ISO 639-2 code for "No linguistic content/not applicable".
If the language can not be determined, or the detection process fails, the detected_lang field will return und, the reserved ISO 639-2 code for undetermined language, and the detected_lang_confidence score will be 0.
Request
- Base URLhttps://api.lilt.com
- URLhttps://api.lilt.com/v2/files
- AuthHTTP basic
Query parameters
A file name.
A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.
Flag indicating whether to perform language detection on the uploaded file. Default is false.
The project to associate the uploaded file with.
The category of the file. The options are REFERENCE, or API. The default is API. Files with the REFERENCE category will be displayed as reference material.
Comma-separated list of labels to add to the uploaded document.
Specifies the job type when adding this file to a job.
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 SourceFile object.
Example response
{
"id": 46530,
"name": "en_US.json",
"file_hash": "3858f62230ac3c915f300c664312c63f",
"detected_lang": "de",
"detected_lang_confidence": 0.7,
"category": "REFERENCE",
"labels": [],
"created_at": "2019-10-16T22:12:34Z",
"updated_at": "2019-10-16T22:12:34Z"
}Changes
- breaking
added the new required
queryrequest parametername - breaking
added required request body
- info
api operation id
uploadFilewas added - info
added the new optional
queryrequest parametercategory - info
added the new optional
queryrequest parameterfile_hash - info
added the new optional
queryrequest parameterjob_type - info
added the new optional
queryrequest parameterlabels - info
added the new optional
queryrequest parameterlangId - info
added the new optional
queryrequest parameterproject_id - info
added the non-success response with the status
- info
added the success response with the status
- breaking