curl --request POST \
--url https://api.lilt.com/v2/memories/import \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/octet-stream' \
--header 'memory_id: <memory_id>' \
--header 'name: <name>' \
--data '"<string>"'import requests
url = "https://api.lilt.com/v2/memories/import"
payload = "<string>"
headers = {
"memory_id": "<memory_id>",
"name": "<name>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
memory_id: '<memory_id>',
name: '<name>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('https://api.lilt.com/v2/memories/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lilt.com/v2/memories/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/octet-stream",
"memory_id: <memory_id>",
"name: <name>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lilt.com/v2/memories/import"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("memory_id", "<memory_id>")
req.Header.Add("name", "<name>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lilt.com/v2/memories/import")
.header("memory_id", "<memory_id>")
.header("name", "<name>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lilt.com/v2/memories/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["memory_id"] = '<memory_id>'
request["name"] = '<name>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"id": 123,
"isProcessing": 1
}"<string>"{
"message": "Internal server error."
}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:
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.
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
curl --request POST \
--url https://api.lilt.com/v2/memories/import \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/octet-stream' \
--header 'memory_id: <memory_id>' \
--header 'name: <name>' \
--data '"<string>"'import requests
url = "https://api.lilt.com/v2/memories/import"
payload = "<string>"
headers = {
"memory_id": "<memory_id>",
"name": "<name>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
memory_id: '<memory_id>',
name: '<name>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('https://api.lilt.com/v2/memories/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lilt.com/v2/memories/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/octet-stream",
"memory_id: <memory_id>",
"name: <name>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lilt.com/v2/memories/import"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("memory_id", "<memory_id>")
req.Header.Add("name", "<name>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lilt.com/v2/memories/import")
.header("memory_id", "<memory_id>")
.header("name", "<name>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lilt.com/v2/memories/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["memory_id"] = '<memory_id>'
request["name"] = '<name>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"id": 123,
"isProcessing": 1
}"<string>"{
"message": "Internal server error."
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Headers
A unique Memory identifier.
Name of the TM or termbase file.
Contains Filter information Unique to SDLXLIFF
Show child attributes
Show child attributes
A flag indicating whether an imported Termbase CSV has a header row or not (the default value is false).
A flag indicating whether or not to skip the import of segments
which already exist in the memory. (the default value is false).
Body
The file contents to be uploaded. The entire POST body will be treated as the file.
The body is of type file.
Was this page helpful?

