Skip to content

lilt/lilt-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openapi-java-client

Lilt REST API

  • API version: 3.0.0
    • Build date: 2024-11-14T22:57:19.235Z[GMT]

Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals
The Lilt REST API enables programmatic access to the full-range of Lilt backend services including:

  • Training of and translating with interactive, adaptive machine translation
  • Large-scale translation memory
  • The Lexicon (a large-scale termbase)
  • Programmatic control of the Lilt CAT environment
  • Translation memory synchronization

Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is https://api.lilt.com/.

Authentication

Requests are authenticated via REST API key, which requires the Business plan.

Requests are authenticated using HTTP Basic Auth. Add your REST API key as both the username and password.

For development, you may also pass the REST API key via the key query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use.

Quotas

Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>org.openapitools</groupId>
  <artifactId>openapi-java-client</artifactId>
  <version>3.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "org.openapitools:openapi-java-client:3.0.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/openapi-java-client-3.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import com.lilt.client.ApiClient;
import com.lilt.client.ApiException;
import com.lilt.client.Configuration;
import com.lilt.client.auth.*;
import com.lilt.client.models.*;
import com.lilt.client.api.CreateApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lilt.com");
    
    // Configure API key authorization: ApiKeyAuth
    ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
    ApiKeyAuth.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKeyAuth.setApiKeyPrefix("Token");

    // Configure HTTP basic authorization: BasicAuth
    HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
    BasicAuth.setUsername("YOUR USERNAME");
    BasicAuth.setPassword("YOUR PASSWORD");

    CreateApi apiInstance = new CreateApi(defaultClient);
    Integer contentId = 56; // Integer | The content ID.
    try {
      InlineResponse200 result = apiInstance.deleteLiltCreateContent(contentId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CreateApi#deleteLiltCreateContent");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Checking Credentials

If you would like to test your credentials using our functionality tests you can do the following.

Navigate to the folder where the package is installed. In the command line run:

export API_HOST="{host}"
export API_KEY="{key}"

Replacing {host} and {key} with the credentials you were given. Make sure to include the quotation marks.

Then while inside the package folder, run:

mvn test

You should be able to see the tests run.

Documentation for API Endpoints

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

Class Method HTTP request Description
CreateApi deleteLiltCreateContent DELETE /v2/create/{contentId} Delete Lilt Create content
CreateApi generateLiltCreateContent POST /v2/create Generate new Lilt Create content
CreateApi getLiltCreateById GET /v2/create/{contentId} Get Lilt Create content by ID.
CreateApi getLiltCreateContent GET /v2/create Get Lilt Create content
CreateApi getLiltCreatePreferences GET /v2/create/preferences Get Lilt Create preferences
CreateApi regenerateLiltCreateContent GET /v2/create/{contentId}/create Regenerate Lilt Create content
CreateApi signLiltCreateTerms POST /v2/create/terms-and-conditions Sign the Lilt Create terms and conditions
CreateApi updateLiltCreateContent PUT /v2/create/{contentId} Update Lilt Create content
CreateApi updateLiltCreatePreferences PUT /v2/create/preferences Update Lilt Create preferences
DocumentsApi downloadDocument GET /v2/documents/files Download a Document
DocumentsApi uploadDocument POST /v2/documents/files Upload a File
FilesApi addLabel POST /v2/files/labels Add Label to File
FilesApi deleteFile DELETE /v2/files Delete a File
FilesApi download GET /v2/files/download Download file
FilesApi getFiles GET /v2/files Retrieve a File
FilesApi removeLabel DELETE /v2/files/labels Remove Label from File
FilesApi uploadFile POST /v2/files Upload a File
JobsApi archiveJob POST /v2/jobs/{jobId}/archive Archive a Job
JobsApi createJob POST /v2/jobs Create a Job
JobsApi deleteJob DELETE /v2/jobs/{jobId} Delete a Job
JobsApi deliverJob POST /v2/jobs/{jobId}/deliver Deliver a Job
JobsApi downloadJob GET /v2/jobs/{jobId}/download Download a Job
JobsApi exportJob GET /v2/jobs/{jobId}/export Export a Job
JobsApi getJob GET /v2/jobs/{jobId} Retrieve a Job
JobsApi getJobLeverageStats POST /v2/jobs/{jobId}/stats Retrieve Job Leverage Stats
JobsApi reactivateJob POST /v2/jobs/{jobId}/reactivate Reactivate a Job
JobsApi retrieveAllJobs GET /v2/jobs Retrieve all Jobs
JobsApi unarchiveJob POST /v2/jobs/{jobId}/unarchive Unarchive a Job
JobsApi updateJob PUT /v2/jobs/{jobId} Update a Job
LanguagesApi getLanguages GET /v2/languages Retrieve supported languages
MemoriesApi createMemory POST /v2/memories Create a Memory
MemoriesApi deleteMemory DELETE /v2/memories Delete a Memory
MemoriesApi deleteSegmentFromMemory DELETE /v2/memories/segment Delete a segment from a memory.
MemoriesApi downloadTermbase GET /v2/memories/termbase/download Termbase download for a Memory
MemoriesApi exportTermbase POST /v2/memories/termbase/export Termbase export for a Memory
MemoriesApi getMemory GET /v2/memories Retrieve a Memory
MemoriesApi importMemoryFile POST /v2/memories/import File import for a Memory
MemoriesApi queryMemory GET /v2/memories/query Query a Memory
MemoriesApi updateMemory PUT /v2/memories Update the name of a Memory
ProjectsApi createProject POST /v2/projects Create a Project
ProjectsApi deleteProject DELETE /v2/projects Delete a Project
ProjectsApi getProjects GET /v2/projects Retrieve a Project
TranslateApi batchTranslateFile POST /v2/translate/file Translate a File
TranslateApi downloadFile GET /v2/translate/files Download translated file
TranslateApi monitorFileTranslation GET /v2/translate/file Monitor file translation
TranslateApi translateSegmentPost POST /v2/translate Translate a segment
WorkflowsApi getWorkflowTemplates GET /v2/workflows/templates Retrieve workflow templates

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: key
  • Location: URL query string

BasicAuth

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author