Files

Upload 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.

post/v2/files

Request

  • Base URL
    https://api.lilt.com
  • URL
    https://api.lilt.com/v2/files
  • Auth
    HTTP basic

Query parameters

namestring required

A file name.

file_hashstring

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.

langIdboolean

Flag indicating whether to perform language detection on the uploaded file. Default is false.

project_idinteger

The project to associate the uploaded file with.

categorystring

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.

labelsstring

Comma-separated list of labels to add to the uploaded document.

job_type'TRANSLATION' | 'PROMPT_RESPONSE'

Specifies the job type when adding this file to a job.

Request body application/octet-stream

string binary required

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.

idinteger

A unique number identifying the SourceFile.

namestring

The file name.

file_hashstring

A unique hash value associated with the file. An MD5 hash of the file content will be used by default.

detected_langstring

Language associated with the file.

detected_lang_confidencenumber

Confidence score for the language associated with the file.

categorystring

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.

labelsstring[]

The list of labels associated with the file.

created_atstring date-time

Time at which the object was created.

updated_atstring date-time

Time at which the object was created.

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 query request parameter name

    • breaking

      added required request body

    • info

      api operation id uploadFile was added

    • info

      added the new optional query request parameter category

    • info

      added the new optional query request parameter file_hash

    • info

      added the new optional query request parameter job_type

    • info

      added the new optional query request parameter labels

    • info

      added the new optional query request parameter langId

    • info

      added the new optional query request parameter project_id

    • info

      added the non-success response with the status

    • info

      added the success response with the status