All URIs are relative to https://api.lilt.com
Method | HTTP request | Description |
---|---|---|
createMemory | POST /v2/memories | Create a Memory |
deleteMemory | DELETE /v2/memories | Delete a Memory |
deleteSegmentFromMemory | DELETE /v2/memories/segment | Delete a segment from a memory. |
downloadTermbase | GET /v2/memories/termbase/download | Termbase download for a Memory |
exportTermbase | POST /v2/memories/termbase/export | Termbase export for a Memory |
getMemory | GET /v2/memories | Retrieve a Memory |
importMemoryFile | POST /v2/memories/import | File import for a Memory |
queryMemory | GET /v2/memories/query | Query a Memory |
updateMemory | PUT /v2/memories | Update the name of a Memory |
Memory createMemory(body)
Create a Memory
Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only). <a href="https://support.lilt.com/hc/en-us/sections/360012579193-Lilt-Translate-Engine\" target=_blank>Refer to our KB</a> for a more detailed description.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let body = new LiltNode.MemoryCreateParameters(); // MemoryCreateParameters |
apiInstance.createMemory(body).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | MemoryCreateParameters |
- Content-Type: application/json
- Accept: application/json, application/octet-stream, text/plain
MemoryDeleteResponse deleteMemory(id)
Delete a Memory
Delete a Memory.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let id = 56; // Number | A unique Memory identifier.
apiInstance.deleteMemory(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | A unique Memory identifier. |
- Content-Type: Not defined
- Accept: application/json, application/octet-stream, text/plain
DeleteSegmentFromMemoryResponse deleteSegmentFromMemory(id, segmentId)
Delete a segment from a memory.
Delete a segment from a memory. ```bash curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID ```
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let id = 56; // Number | A unique Memory identifier.
let segmentId = 56; // Number | A unique Segment identifier.
apiInstance.deleteSegmentFromMemory(id, segmentId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | A unique Memory identifier. | |
segmentId | Number | A unique Segment identifier. |
DeleteSegmentFromMemoryResponse
- Content-Type: Not defined
- Accept: application/json, application/octet-stream, text/plain
Blob downloadTermbase(id)
Termbase download for a Memory
Downloads the termbase export for the given memory as a CSV file. Ensure you first call the `/2/memories/termbase/export` endpoint to start the export process before you try to download it. ```bash curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID ```
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let id = 56; // Number | A unique Memory identifier.
apiInstance.downloadTermbase(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | A unique Memory identifier. |
Blob
- Content-Type: Not defined
- Accept: application/json, application/octet-stream, text/plain
TermbaseExportResponse exportTermbase(id)
Termbase export for a Memory
Exports the termbase entries for the given memory into a CSV file. Calling this endpoint will begin the export process in the background. Check that the processing is complete by polling the `GET /2/memories` endpoint. When the `is_processing` value is 0 then call the `POST /2/memories/termbase/download` endpoint. ```bash curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID ```
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let id = 56; // Number | A unique Memory identifier.
apiInstance.exportTermbase(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | A unique Memory identifier. |
- Content-Type: Not defined
- Accept: application/json, application/octet-stream, text/plain
[Memory] getMemory(opts)
Retrieve a Memory
Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory).
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let opts = {
'id': 56 // Number | An optional Memory identifier.
};
apiInstance.getMemory(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | An optional Memory identifier. | [optional] |
- Content-Type: Not defined
- Accept: application/json, application/octet-stream, text/plain
MemoryImportResponse importMemoryFile(memoryId, name, body, opts)
File import for a Memory
Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `.tmx`, `.sdltm`, `.sdlxliff`(With custom Filters), '.xliff', and `.tmq` for TM data; `.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`. Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory: ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \ --header "LILT-API: {\"name\": \"my_memory.sdltm\",\"memory_id\": 42}" \ --header "Content-Type: application/octet-stream" \ --data-binary @my_memory.sdltm ``` Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments. ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \ --header "LILT-API: {\"name\": \"my_memory.sdlxliff\",\"memory_id\": 12,\"sdlxliff_filters\":[{\"conf_name\": \"Translated\", \"percentage\": 100, \"allow_unlocked\": false}]"}" \ --header "Content-Type: application/octet-stream" \ --data-binary @my_memory.sdlxliff ```
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let memoryId = 56; // Number | A unique Memory identifier.
let name = "name_example"; // String | Name of the TM or termbase file.
let body = "/path/to/file"; // File | The file contents to be uploaded. The entire POST body will be treated as the file.
let opts = {
'sdlxliffFilters': [new LiltNode.SDLXLIFFFilter()], // [SDLXLIFFFilter] | Contains Filter information Unique to SDLXLIFF
'hasHeaderRow': true, // Boolean | A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).
'skipDuplicates': true // Boolean | A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`).
};
apiInstance.importMemoryFile(memoryId, name, body, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
memoryId | Number | A unique Memory identifier. | |
name | String | Name of the TM or termbase file. | |
body | File | The file contents to be uploaded. The entire POST body will be treated as the file. | |
sdlxliffFilters | [SDLXLIFFFilter] | Contains Filter information Unique to SDLXLIFF | [optional] |
hasHeaderRow | Boolean | A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`). | [optional] |
skipDuplicates | Boolean | A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). | [optional] |
- Content-Type: application/octet-stream
- Accept: application/json, application/octet-stream, text/plain
[TranslationMemoryEntry] queryMemory(id, query, opts)
Query a Memory
Perform a translation memory query.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let id = 56; // Number | A unique Memory identifier.
let query = "query_example"; // String | A source query.
let opts = {
'n': 10 // Number | Maximum number of results to return.
};
apiInstance.queryMemory(id, query, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | A unique Memory identifier. | |
query | String | A source query. | |
n | Number | Maximum number of results to return. | [optional] [default to 10] |
- Content-Type: Not defined
- Accept: application/json, application/octet-stream, text/plain
Memory updateMemory(body)
Update the name of a Memory
Update a Memory.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.MemoriesApi();
let body = new LiltNode.MemoryUpdateParameters(); // MemoryUpdateParameters |
apiInstance.updateMemory(body).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | MemoryUpdateParameters |
- Content-Type: application/json
- Accept: application/json, application/octet-stream, text/plain