Documents

Create 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
post/v2/documents/files

Request

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

Headers

namestring required

A file name.

project_idinteger required

A unique Project identifier.

pretranslatestring

An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are TM, or TM+MT

auto_acceptboolean

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.

case_sensitiveboolean

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

match_attributionboolean

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

config_idinteger

An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.

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 Document object.

idinteger

A unique number identifying the Document.

project_idinteger

A unique number identifying the Project.

srclangstring

An ISO 639-1 language identifier.

trglangstring

An ISO 639-1 language identifier.

namestring

The document name.

import_in_progressboolean

True if the document is currently being imported

import_succeededboolean

True if the import process succeeded.

import_error_messagestring

Error message if import_succeeded=false

export_in_progressboolean

True if the document is currently being exported for download

export_succeededboolean

True if the export process succeeded.

export_error_messagestring

Error message if export_succeeded=false

is_pretranslatingboolean

True if the document is currently being pretranslated.

translator_emailstring

The email of the assigned translator.

reviewer_emailstring

The email of the assigned reviewer.

created_atinteger

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_atinteger

Time at which the object was created. Measured in seconds since the Unix epoch.

is_review_completeboolean

Document review status.

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

    • breaking

      added the new required header request parameter project_id

    • breaking

      added required request body

    • info

      api operation id uploadDocument was added

    • info

      added the new optional header request parameter auto_accept

    • info

      added the new optional header request parameter case_sensitive

    • info

      added the new optional header request parameter config_id

    • info

      added the new optional header request parameter match_attribution

    • info

      added the new optional header request parameter pretranslate

    • info

      added the non-success response with the status

    • info

      added the success response with the status