Update a Job
curl --request PUT \
--url https://api.lilt.com/v2/jobs/{jobId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My new Job",
"due": "2021-10-05T14:48:00.000Z",
"isProcessing": "ExportError",
"processingErrorMsg": "Authentication failed. Check your Contentful API Key."
}
'import requests
url = "https://api.lilt.com/v2/jobs/{jobId}"
payload = {
"name": "My new Job",
"due": "2021-10-05T14:48:00.000Z",
"isProcessing": "ExportError",
"processingErrorMsg": "Authentication failed. Check your Contentful API Key."
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My new Job',
due: '2021-10-05T14:48:00.000Z',
isProcessing: 'ExportError',
processingErrorMsg: 'Authentication failed. Check your Contentful API Key.'
})
};
fetch('https://api.lilt.com/v2/jobs/{jobId}', 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/jobs/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My new Job',
'due' => '2021-10-05T14:48:00.000Z',
'isProcessing' => 'ExportError',
'processingErrorMsg' => 'Authentication failed. Check your Contentful API Key.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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/jobs/{jobId}"
payload := strings.NewReader("{\n \"name\": \"My new Job\",\n \"due\": \"2021-10-05T14:48:00.000Z\",\n \"isProcessing\": \"ExportError\",\n \"processingErrorMsg\": \"Authentication failed. Check your Contentful API Key.\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.lilt.com/v2/jobs/{jobId}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My new Job\",\n \"due\": \"2021-10-05T14:48:00.000Z\",\n \"isProcessing\": \"ExportError\",\n \"processingErrorMsg\": \"Authentication failed. Check your Contentful API Key.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lilt.com/v2/jobs/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My new Job\",\n \"due\": \"2021-10-05T14:48:00.000Z\",\n \"isProcessing\": \"ExportError\",\n \"processingErrorMsg\": \"Authentication failed. Check your Contentful API Key.\"\n}"
response = http.request(request)
puts response.read_body{
"name": "My New Job",
"creationStatus": "COMPLETE",
"deliveredAt": "2021-06-03T13:43:00Z",
"status": "active",
"due": "2021-06-03T13:43:00Z",
"id": 241,
"isProcessing": 0,
"stats": {
"exactWords": 0,
"fuzzyWords": 0,
"newWords": 0,
"numDeliveredProjects": 0,
"numLanguagePairs": 0,
"numProjects": 0,
"percentReviewed": 0,
"percentTranslated": 0,
"projects": [
{
"id": 123,
"srcLang": "en",
"srcLocale": "US",
"trgLang": "fr",
"trgLocale": "CA",
"name": "My new project",
"due": "2021-10-03T13:43:00.000Z",
"isComplete": false,
"isArchived": false,
"state": "inProgress",
"numSourceTokens": 2134,
"createdAt": "2021-04-01T13:43:00.000Z",
"updatedAt": "2021-06-03T13:43:00.000Z",
"isDeleted": false,
"memoryId": 2134,
"workflowStatus": "READY_TO_START",
"workflowName": "Translate > Review > Analyst Review"
}
],
"sourceWords": 0,
"uniqueLanguagePairs": 1,
"uniqueLinguists": 1,
"workflowStatus": "READY_TO_START"
},
"domains": [
{
"id": 12,
"name": "Marketing"
}
]
}"<string>"{
"message": "Internal server error."
}Jobs
Update a Job
Updates a job with the new job properties. To update a specific job, you will need the job id in the url path.
You can update job’s name and due date by passing the property and new value in the body.
Example CURL command:
curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test job",
"due": "2022-05-05T10:56:44.985Z"
}'
PUT
/
v2
/
jobs
/
{jobId}
Update a Job
curl --request PUT \
--url https://api.lilt.com/v2/jobs/{jobId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My new Job",
"due": "2021-10-05T14:48:00.000Z",
"isProcessing": "ExportError",
"processingErrorMsg": "Authentication failed. Check your Contentful API Key."
}
'import requests
url = "https://api.lilt.com/v2/jobs/{jobId}"
payload = {
"name": "My new Job",
"due": "2021-10-05T14:48:00.000Z",
"isProcessing": "ExportError",
"processingErrorMsg": "Authentication failed. Check your Contentful API Key."
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My new Job',
due: '2021-10-05T14:48:00.000Z',
isProcessing: 'ExportError',
processingErrorMsg: 'Authentication failed. Check your Contentful API Key.'
})
};
fetch('https://api.lilt.com/v2/jobs/{jobId}', 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/jobs/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My new Job',
'due' => '2021-10-05T14:48:00.000Z',
'isProcessing' => 'ExportError',
'processingErrorMsg' => 'Authentication failed. Check your Contentful API Key.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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/jobs/{jobId}"
payload := strings.NewReader("{\n \"name\": \"My new Job\",\n \"due\": \"2021-10-05T14:48:00.000Z\",\n \"isProcessing\": \"ExportError\",\n \"processingErrorMsg\": \"Authentication failed. Check your Contentful API Key.\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.lilt.com/v2/jobs/{jobId}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My new Job\",\n \"due\": \"2021-10-05T14:48:00.000Z\",\n \"isProcessing\": \"ExportError\",\n \"processingErrorMsg\": \"Authentication failed. Check your Contentful API Key.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lilt.com/v2/jobs/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My new Job\",\n \"due\": \"2021-10-05T14:48:00.000Z\",\n \"isProcessing\": \"ExportError\",\n \"processingErrorMsg\": \"Authentication failed. Check your Contentful API Key.\"\n}"
response = http.request(request)
puts response.read_body{
"name": "My New Job",
"creationStatus": "COMPLETE",
"deliveredAt": "2021-06-03T13:43:00Z",
"status": "active",
"due": "2021-06-03T13:43:00Z",
"id": 241,
"isProcessing": 0,
"stats": {
"exactWords": 0,
"fuzzyWords": 0,
"newWords": 0,
"numDeliveredProjects": 0,
"numLanguagePairs": 0,
"numProjects": 0,
"percentReviewed": 0,
"percentTranslated": 0,
"projects": [
{
"id": 123,
"srcLang": "en",
"srcLocale": "US",
"trgLang": "fr",
"trgLocale": "CA",
"name": "My new project",
"due": "2021-10-03T13:43:00.000Z",
"isComplete": false,
"isArchived": false,
"state": "inProgress",
"numSourceTokens": 2134,
"createdAt": "2021-04-01T13:43:00.000Z",
"updatedAt": "2021-06-03T13:43:00.000Z",
"isDeleted": false,
"memoryId": 2134,
"workflowStatus": "READY_TO_START",
"workflowName": "Translate > Review > Analyst Review"
}
],
"sourceWords": 0,
"uniqueLanguagePairs": 1,
"uniqueLinguists": 1,
"workflowStatus": "READY_TO_START"
},
"domains": [
{
"id": 12,
"name": "Marketing"
}
]
}"<string>"{
"message": "Internal server error."
}Authorizations
Body
application/json
The Job resource to update.
Response
A job object.
A Job is a collection of multiple Projects. Each project is specific to a language pair, and is associated with exactly one Memory for that language pair. The Memory association cannot be changed after the Project is created.
Was this page helpful?

