Back to top

Lilt API

The Lilt API enables programmatic configuration of the Lilt CAT environment (the Interface) and access to domain-adapted TM/MT systems. It can also be used to augment an existing translation management system with Lilt translation technology. The API is distinguished by the following features:

  • Real-time personalization / training to target domains.

  • Integrated translation memory.

  • Rich translation output including n-best lists, word alignments, and formatting advice.

  • Programmatic configuration of the Lilt CAT environment.

Requests

Format

Requests and responses are in JSON format.

HTTPS / SSL

The API only responds to HTTPS / SSL requests.

Authentication

The API authenticates via an API key, which is included with the Enterprise plan. Every API endpoint must include the apikey query parameter.

Resource Group

API Root

This resource does not have any attributes. It lists the top-level API endpoints. Use it to verify API keys.

Retrieve the Entry Point
GET/

Example URI

GET http://lilt.com/1/
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "project_management_url": "/pm",
  "memory_url": "/mem",
  "translation_url": "/tr"
}

Project Management

Create a Project
POST/pm/project

Create a Project resource. A Project is a container for Document resources.

Example URI

POST http://lilt.com/1/pm/project
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "memory_id": 1,
  "name": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "memory_id": {
      "type": "number",
      "description": "The Memory with which this segment is associated."
    },
    "name": {
      "type": "string",
      "description": "A name for the Project."
    }
  },
  "required": [
    "memory_id",
    "name"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "project_id": 1,
  "srclang": "Hello, world!",
  "tgtlang": "Hello, world!",
  "memory_id": 1,
  "name": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "project_id": {
      "type": "number",
      "description": "A unique Project identifier."
    },
    "srclang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "tgtlang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "memory_id": {
      "type": "number",
      "description": "The Memory with which this segment is associated."
    },
    "name": {
      "type": "string",
      "description": "A name for the Project."
    }
  },
  "required": [
    "project_id",
    "srclang",
    "tgtlang",
    "memory_id",
    "name"
  ]
}

Add source Segment
POST/pm/segment

Add a source Segment to a Document resource.

Example URI

POST http://lilt.com/1/pm/segment
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "text": "Hello, world!",
  "project_id": 1,
  "doc_id": 1,
  "doc_name": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "The source string."
    },
    "project_id": {
      "type": "number",
      "description": "The Project id."
    },
    "doc_id": {
      "type": "number",
      "description": "The Document id. If unspecified, then a new document is created."
    },
    "doc_name": {
      "type": "string",
      "description": "Optional name for new documents."
    }
  },
  "required": [
    "text",
    "project_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "segment_id": 1,
  "doc_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "segment_id": {
      "type": "number",
      "description": "Unique Segment identifier."
    },
    "doc_id": {
      "type": "number",
      "description": "Unique Document identifier."
    }
  },
  "required": [
    "segment_id",
    "doc_id"
  ]
}

Get source Segment
GET/pm/segment{?id}

Get a Segment resource, including a target string, if any, that was created in the Interface.

Example URI

GET http://lilt.com/1/pm/segment?id=778
URI Parameters
HideShow
id
number (required) Example: 778
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "source": "Hello, world!",
  "target": "Hello, world!",
  "doc_id": 1,
  "srclang": "Hello, world!",
  "tgtlang": "Hello, world!",
  "memory_id": 1,
  "created_at": "Hello, world!",
  "updated_at": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "The source string."
    },
    "target": {
      "type": "string",
      "description": "The target string."
    },
    "doc_id": {
      "type": "number",
      "description": "Unique Document identifier."
    },
    "srclang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "tgtlang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "memory_id": {
      "type": "number",
      "description": "The memory with which this segment is associated."
    },
    "created_at": {
      "type": "string",
      "description": "An ISO8601 date."
    },
    "updated_at": {
      "type": "string",
      "description": "An ISO8601 date."
    }
  },
  "required": [
    "source",
    "target",
    "doc_id",
    "srclang",
    "tgtlang",
    "created_at",
    "updated_at"
  ]
}

List all Projects
GET/pm/project{?srclang,trglang}

List all active Project resources. Deleted Project resources are not returned.

Example URI

GET http://lilt.com/1/pm/project?srclang=en&trglang=fr
URI Parameters
HideShow
srclang
string (optional) Example: en
trglang
string (optional) Example: fr
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "projects": [
    {
      "project_id": 1234,
      "memory_id": 7245,
      "srclang": "en",
      "tgtlang": "fr",
      "name": "Walker Percy Letters"
    },
    {
      "project_id": 446,
      "memory_id": 9043,
      "srclang": "en",
      "tgtlang": "nl",
      "name": "Faulkner Essays"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "projects": {
      "type": "array",
      "description": "An array of unique source segment ids, one per segment."
    }
  },
  "required": [
    "projects"
  ]
}

List all Documents for Project
GET/pm/project/docs{?id}

List all Document resources for a Project resource.

Example URI

GET http://lilt.com/1/pm/project/docs?id=778
URI Parameters
HideShow
id
number (required) Example: 778
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "documents" : [
        {
            "doc_id" : 778
            "srclang" : "en",
            "tgtlang" : "nl",
            "name" : "A Note on Sherwood Anderson"
        },
        {
            "doc_id": 787,
            "srclang" : "en",
            "tgtlang" : "nl",
            "name" : "Mississippi"
        }
    ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array",
      "description": "An array of Document resources."
    }
  },
  "required": [
    "documents"
  ]
}

Share/Unshare a Document
PUT/pm/project/docs/share

Share a Document with a user for translation in the Interface. This endpoint can also be used to unshare the Document.

Example URI

PUT http://lilt.com/1/pm/project/docs/share
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "project_id": 1,
  "doc_id": 1,
  "email": "Hello, world!",
  "share": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "project_id": {
      "type": "number",
      "description": "A unique Project identifier."
    },
    "doc_id": {
      "type": "number",
      "description": "A unique Document identifier."
    },
    "email": {
      "type": "string",
      "description": "An email address."
    },
    "share": {
      "type": "boolean",
      "description": "If false, then unshare the document."
    }
  },
  "required": [
    "project_id",
    "doc_id",
    "email",
    "share"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "doc_id": 1,
  "share": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "doc_id": {
      "type": "number",
      "description": "A unique Document identifier."
    },
    "share": {
      "type": "boolean",
      "description": "If false, then unshare the document."
    }
  },
  "required": [
    "doc_id",
    "share"
  ]
}

Memory

A Memory is a collection of parallel (source/target) segments from which a MT/TM model is trained. When a translator confirms a segment in the Interface, a parallel segment is added to the Memory. Parallel segments from existing translation memories and bitexts can also be added to the Memory via the API.

Create a Memory
POST/mem/create

Create a new Memory.

Example URI

POST http://lilt.com/1/mem/create
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "srclang": "Hello, world!",
  "tgtlang": "Hello, world!",
  "name": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "srclang": {
      "type": "string",
      "description": "An ISO639-1 language identifier."
    },
    "tgtlang": {
      "type": "string",
      "description": "An ISO639-1 language identifier."
    },
    "name": {
      "type": "string",
      "description": "A name for the Memory."
    }
  },
  "required": [
    "srclang",
    "tgtlang",
    "name"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "memory_id": 1,
  "srclang": "Hello, world!",
  "tgtlang": "Hello, world!",
  "name": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "memory_id": {
      "type": "number",
      "description": "Unique Memory identifier."
    },
    "srclang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "tgtlang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "name": {
      "type": "string",
      "description": "A user-defined alias for this memory."
    }
  },
  "required": [
    "memory_id",
    "srclang",
    "tgtlang"
  ]
}

View Memories
GET/mem{?memory_id}

View the status of a Memory by specifying memory_id. Omit the memory_id to list all Memories associated with the API key.

Example URI

GET http://lilt.com/1/mem?memory_id=567
URI Parameters
HideShow
memory_id
number (optional) Example: 567
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "memory_id": "Hello, world!",
  "srclang": "Hello, world!",
  "tgtlang": "Hello, world!",
  "name": "Hello, world!",
  "nexamples": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "memory_id": {
      "type": "string",
      "description": "Unique Memory identifier."
    },
    "srclang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "tgtlang": {
      "type": "string",
      "description": "An ISO639-1 language string."
    },
    "name": {
      "type": "string",
      "description": "A user-defined alias for this memory."
    },
    "nexamples": {
      "type": "number",
      "description": "The number of Example objects incorporated into this Memory."
    }
  },
  "required": [
    "memory_id",
    "srclang",
    "tgtlang",
    "nexamples"
  ]
}

Add a translation to the Memory
POST/mem

Add a translation for a source segment to a Memory. The translation will influence future predictions of the designated memory_id. Either an existing segment_id or a source string—but not both—may be supplied.

Example URI

POST http://lilt.com/1/mem
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "memory_id": 1,
  "segment_id": 1,
  "source": "Hello, world!",
  "target": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "memory_id": {
      "type": "number",
      "description": "Unique memory identifier."
    },
    "segment_id": {
      "type": "number",
      "description": "Unique segment identifier."
    },
    "source": {
      "type": "string",
      "description": "The source string."
    },
    "target": {
      "type": "string",
      "description": "The target string."
    }
  },
  "required": [
    "memory_id",
    "target"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "updated_at": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "updated_at": {
      "type": "string",
      "description": "An ISO8601 date."
    }
  },
  "required": [
    "updated_at"
  ]
}

Translate

Get translations for a segment.

Translate a segment
GET/tr{?memory_id,source,n,rich}

Translate a source string. Use the rich parameter to show the rich output shown in this output. When this parameter is omitted, a ranked list of translations is returned.

Example URI

GET http://lilt.com/1/tr?memory_id=1234&source=Call me Ishmael&n=10&rich=true
URI Parameters
HideShow
memory_id
number (required) Example: 1234
source
string (required) Example: Call me Ishmael
n
number (optional) Example: 10
rich
boolean (optional) Example: true
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    source : "The red bus .",
    sourceDelimiters : [""," "," ", " ", ""],
    translation : [
        {
            "target" : "Le bus rouge .",
            "align" : "0-0 1-2 2-1 3-3",
            "score" : 0.2378,
            "targetDelimiters" : [""," ", " ", " ",""],
            "provenance" : "0 0 1 0"
        },
            "target" : "Le rouge bus .",
            "align" : "0-0 1-1 2-2 3-3",
            "score" : 0.17,
            "targetDelimiters" : [""," ", " ", " ", ""],
            "provenance" : "1 0 2 0"
        }
    ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "The tokenized source segment."
    },
    "sourceDelimiters": {
      "type": "string",
      "description": "A format string that indicates, for each token, if the token should be preceded by a space."
    },
    "translation": {
      "type": "array",
      "description": "One or more Translation objects."
    }
  },
  "required": [
    "source",
    "sourceDelimiters",
    "translation"
  ]
}

Generated by aglio on 03 Dec 2016