lilt-node

Lilt API Binding for Javascript

View the Project on GitHub lilt/lilt-node

LiltNode.JobsApi

All URIs are relative to https://lilt.com/2

Method HTTP request Description
archiveJob POST /jobs/{jobId}/archive Archive a Job
createJob POST /jobs Create a Job
deleteJob DELETE /jobs/{jobId} Delete a Job
deliverJob POST /jobs/{jobId}/deliver Deliver a Job
downloadJob GET /jobs/{jobId}/downlod Download a Job
exportJob GET /jobs/{jobId}/export Export a Job
getJob GET /jobs/{jobId} Retrieve a Job
getJobLeverageStats POST /jobs/{jobId}/stats Retrieve Job Leverage Stats
reactivateJob POST /jobs/{jobId}/reactivate Reactivate a Job
retrieveAllJobs GET /jobs Retrieve all Jobs
unarchiveJob POST /jobs/{jobId}/unarchive Unarchive a Job
updateJob PUT /jobs/{jobId} Update a Job

archiveJob

Job archiveJob(jobId)

Archive a Job

Set job to archived, unassign all linguists and archive all projects and documents inside the job. It will return the archived job. Example CURL command: ``` curl -X POST 'https://lilt.com/2/jobs/{id}/archive?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.archiveJob(jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

Job

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

createJob

Job createJob(body)

Create a Job

Create a Job. A Job is a collection of Projects. A Job will contain multiple projects, based on the language pair. A Project is associated with exactly one Memory. Jobs appear in the Jobs dashboard of the web app. Example CURL command: ``` curl -X POST 'https://lilt.com/2/jobs?key=API_KEY' \ –header 'Content-Type: application/json' \ –data-raw '{ \"name\": \"test job\", \"fileIds\": [5009, 5010, 5011], \"due\": \"2022-05-05T10:56:44.985Z\", \"srcLang\": \"en\", \"srcLocale\": \"US\", \"languagePairs\": [ { \"memoryId\": 3121, \"trgLang\": \"de\" }, { \"memoryId\": 2508, \"trgLang\": \"fr\" }, { \"memoryId\": 3037, \"trgLang\": \"zh\" } ] }' ```

Example

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.JobsApi();
let body = new LiltNode.JobCreateParameters(); // JobCreateParameters | 
apiInstance.createJob(body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
body JobCreateParameters    

Return type

Job

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

deleteJob

JobDeleteResponse deleteJob(jobId)

Delete a Job

Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories. Example CURL command: ``` curl -X DELETE 'https://lilt.com/2/jobs/{id}?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.deleteJob(jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

JobDeleteResponse

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

deliverJob

Job deliverJob(jobId)

Deliver a Job

Set the job state to delivered and set all the projects in the job to done It will return the delivered job. Example CURL command: ``` curl -X POST 'https://lilt.com/2/jobs/{id}/deliver?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.deliverJob(jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

Job

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

downloadJob

downloadJob(jobId)

Download a Job

Make sure you have exported a job with the same id before using this api. Downloading files requires the exported job `id` in the param. Example CURL command: ``` curl -X GET 'https://lilt.com/2/jobs/{id}/download?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.downloadJob(jobId).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

null (empty response body)

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

exportJob

exportJob(jobId, type)

Export a Job

Prepare job files for download. To export translated documents from the job use the query parameter `type=files`: Example CURL command: ``` curl -X GET 'https://lilt.com/2/jobs/{id}/export?key=API_KEY&type=files' ``` To export job memories use the query parameter `type=memory`. The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress, `0` when idle and `-2` when the export failed.

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
let type = "type_example"; // String | category for files and memory.
apiInstance.exportJob(jobId, type).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  
type String category for files and memory.  

Return type

null (empty response body)

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

getJob

Job getJob(jobId)

Retrieve a Job

Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path. Example CURL command: ``` curl -X GET 'https://lilt.com/2/jobs/{id}?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.getJob(jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

Job

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

getJobLeverageStats

JobLeverageStats getJobLeverageStats(jobId)

Retrieve Job Leverage Stats

Get the TM leverage stats for the job (new/exact/fuzzy matches). Example CURL command: ``` curl -X POST 'https://lilt.com/2/jobs/{id}/stats?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.getJobLeverageStats(jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

JobLeverageStats

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

reactivateJob

Job reactivateJob(jobId)

Reactivate a Job

Set the job state to active. Does not change the state of projects associated with the given job. It will return the reactivated job. Example CURL command: ``` curl -X POST 'https://lilt.com/2/jobs/{id}/reactivate?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.reactivateJob(jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

Job

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

retrieveAllJobs

[Job] retrieveAllJobs(opts)

Retrieve all Jobs

Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API. Example CURL command: ``` curl -X GET 'https://lilt.com/2/jobs?key=API_KEY&isArchived=false' ```

Example

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.JobsApi();
let opts = {
  'isArchived': true, // Boolean | Retrieves all jobs that are archived.
  'isDelivered': true, // Boolean | Retrieves all jobs that are delivered.
  'offset': 56, // Number | Return jobs starting at the offset row. If not given the default offset will be 0.
  'limit': 56 // Number | The maximum number of jobs to be returned. If not given the default limit will be 25.
};
apiInstance.retrieveAllJobs(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
isArchived Boolean Retrieves all jobs that are archived. [optional]
isDelivered Boolean Retrieves all jobs that are delivered. [optional]
offset Number Return jobs starting at the offset row. If not given the default offset will be 0. [optional]
limit Number The maximum number of jobs to be returned. If not given the default limit will be 25. [optional]

Return type

[Job]

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

unarchiveJob

Job unarchiveJob(jobId)

Unarchive a Job

Set job to unarchived, the job will move to active status. Example CURL command: ``` curl -X POST 'https://lilt.com/2/jobs/{id}/unarchive?key=API_KEY' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
apiInstance.unarchiveJob(jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  

Return type

Job

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

updateJob

Job updateJob(jobId, opts)

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://lilt.com/2/jobs/{id}?key=API_KEY' \ –header 'Content-Type: application/json' \ –data-raw '{ \"name\": \"test job\", \"due\": \"2022-05-05T10:56:44.985Z\" }' ```

Example

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.JobsApi();
let jobId = 56; // Number | A job id.
let opts = {
  'body': new LiltNode.JobUpdateParameters() // JobUpdateParameters | 
};
apiInstance.updateJob(jobId, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
jobId Number A job id.  
body JobUpdateParameters   [optional]

Return type

Job

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers