Lengoo Translate API (1.0.0)

Download OpenAPI specification:Download

Introduction

Third-party user-ready API capable of performing fast, high-quality pure HALOS translations. It is the gateway and interface to expose our HALOS technology to external consumers interested in utilizing purely machine-enabled translation.

Quotas: Each HALOS is limited to 6000 request per minute

License

Translate API offers the following licenses.

  • Basic: Allows access to non-realtime translation features like the translation job endpoints.
  • Enterprise: Full access to all the Translate API features.

Try out the API

Postman is a tool that allows you to test and document APIs. It allows you to send various types of HTTP requests to a server and see the response.

To facilitate your integration efforts and allow you to try out Translate API, we provide an API collection file for Postman, which contains examples for the Translate API endpoints and their usage.

Setup Postman and Authorization

  1. Install Postman.
  2. Download the collection file here.
  3. Import the Translate API collection file.
  4. Select the newly imported API collection Lengoo - Translate API then the Variables tab.
  5. For the variable CLIENT_ID add the "client id" provided by Lengoo into the Current Value column.
  6. For the variable CLIENT_SECRET add the "client secret" provided by Lengoo into the Current Value column.
  7. Save the variables by clicking on the 💾 Save button.
  8. Go to the Authorization tab, scroll down and click Get New Access Token which will then be confirmed by a pop-up.
  9. A second pop up window will appear with the token details. Click Use Token.

Making your first request

  1. Select the Language Resources folder then the request named Detect Languages.
  2. The request body will be prefilled with an example, click Send in order to send the HTTP request.
  3. Postman will show the HTTP response in the lower part of the application.

Language Resources

Get All Language Resources

Returns customer's available language resources.

Types of language resources:

  • Machine Translation
  • Translation Memory
  • Term Bank
Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "resources": [
    ]
}

Detect Languages

Detects languages of an array of text and returns the language and score

The request is an array of text and should not have more than 20 elements. The text content in the request body cannot exceed 10,000 characters.

Authorizations:
OAuth2
Request Body schema: application/json

Translate Text

texts
required
Array of strings <= 10000 characters [ 1 .. 20 ] items

Responses

Request samples

Content type
application/json
{
  • "texts": [
    ]
}

Response samples

Content type
application/json
{
  • "detectedLanguages": [
    ]
}

Translate

Translation

Translate text by given sourceLanguage and targetLanguage combination.

The languageResources parameter is optional. If it is not sent, the default customer translation resources will be applied.

With this parameter, the requester can decide which translation resource will be used for translation. The translation algorithm will try to translate in order of languageResources item.

For example, if the languageResources: ["id-of-MachineTranslation-langugage-resource", ""id-of-TranslationMemory-langugage-resource""] is sent like this, the algorithm will run first MachineTranslation for translation. If MachineTranslation can translate the text, then it returns the translations. If it is not then it will search on TranslationMemory to translate the text.

We recommend that the text should be less than or equal to 5000 characters.

The character type is UTF-8 encoded unicode code points.

Payload should be a maximum of 30 kilobytes.

The returned translations array will be in the same order as the provided array.

Authorizations:
OAuth2
Request Body schema: application/json

Translate Text

texts
Array of strings [ 1 .. 32 ] items [ items [ 1 .. 5000 ] characters ]

Texts to be translated

sourceLanguage
required
string </^[a-z]{2}\-[A-Z]{2}$/g> (languageCode)

Language code using ISO 639-1 for language and ISO 3166-1 alpha-2 for country.

targetLanguage
required
string </^[a-z]{2}\-[A-Z]{2}$/g> (languageCode)

Language code using ISO 639-1 for language and ISO 3166-1 alpha-2 for country.

languageResources
Array of strings <uuid> (UUID) non-empty

IDs of the language resources to be used

includeTranslationInfo
boolean

Request additional information regarding the translation

tagStrategy
string
Enum: "split" "retag" "mixed"

Sets the strategy for tag transfer into the target sentence. retag applies a predictive retagging model. split splits the segment on tags, translates the text parts seperately, and puts the segment together in order while mixed strategy is used to distinguish some boundary tags from inline tags (e.g. bold, italics, links) and combines both retag and split methods

termHighlight
boolean

This shows the highlight with tags of the populated termbank (Translation Bank Marketing) matches for easy identification.

Responses

Request samples

Content type
application/json
{
  • "texts": [
    ],
  • "sourceLanguage": "en-US",
  • "targetLanguage": "de-DE",
  • "languageResources": [
    ],
  • "includeTranslationInfo": true,
  • "tagStrategy": "split",
  • "termHighlight": true
}

Response samples

Content type
application/json
{
  • "translations": [
    ]
}

Translation Job

Utilize this to translate a larger amount of texts asynchronously.

Translate text by given sourceLanguage and targetLanguage combination.

The languageResources parameter is optional. If it is not sent, the default customer translation resources will be applied.

With this parameter, the requester can decide which translation resource will be used for translation. The translation algorithm will try to translate in order of languageResources item.

For example, if the languageResources: ["id-of-MachineTranslation-langugage-resource", ""id-of-TranslationMemory-langugage-resource""] is sent like this, the algorithm will run first MachineTranslation for translation. If MachineTranslation can translate the text, then it returns the translations. If it is not then it will search on TranslationMemory to translate the text.

The returned translations array will be in the same order as the provided array.

Authorizations:
OAuth2
Request Body schema: application/json

Bulk Translation input

texts
Array of strings [ 1 .. 500 ] items [ items [ 1 .. 30000 ] characters ]

Text to be translated

sourceLanguage
required
string </^[a-z]{2}\-[A-Z]{2}$/g> (languageCode)

Language code using ISO 639-1 for language and ISO 3166-1 alpha-2 for country.

targetLanguage
required
string </^[a-z]{2}\-[A-Z]{2}$/g> (languageCode)

Language code using ISO 639-1 for language and ISO 3166-1 alpha-2 for country.

languageResources
Array of strings <uuid> (UUID) non-empty

IDs of the language resources to be used

referenceId
string (referenceId) [ 1 .. 50 ] characters

Optional field where you can add a reference identifier string

includeTranslationInfo
boolean

Request additional information regarding the translation

termHighlight
boolean

This shows the highlight with tags of the populated termbank (Translation Bank Marketing) matches for easy identification.

Responses

Request samples

Content type
application/json
{
  • "texts": [
    ],
  • "sourceLanguage": "en-US",
  • "targetLanguage": "de-DE",
  • "languageResources": [
    ],
  • "referenceId": "10c73ddb-fae1-46c9-851d-40e364b121a5",
  • "includeTranslationInfo": true,
  • "termHighlight": true
}

Response samples

Content type
application/json
{
  • "jobId": "cb26237c-3beb-40f3-8e13-77d862f722b5"
}

Get Translation Job

Retrieve Translation Job:

If the translation job status is “active” only the status of the job will be returned.

If the translation job status is “failed” we will return the status and an array containing the errors.

If the translation job is "completed" all translation will be returned as specified in the response schema.

Authorizations:
OAuth2
path Parameters
id
required
string <uuid>

ID of the Job

Responses

Response samples

Content type
application/json
{
  • "status": "active",
  • "referenceId": "10c73ddb-fae1-46c9-851d-40e364b121a5",
  • "translations": [
    ],
  • "errors": [
    ]
}

Translate Files

Upload a file

Upload a file to be translated.

File must be either docx, pptx, xlsx, txt, pdf or image (if ocr is enabled) format.

BETA FEATURE: Additional supported file formats xlf, xliff, mxliff and sdlxliff Issues with these files can be reported via e-mail: integrations@lengoo.com .

The maximum file upload limit is 15 MB or 2.000.000 characters.

IMPORTANT: This endpoint accepts multipart forms instead of JSON.

Authorizations:
OAuth2
Request Body schema: multipart/form-data

Translate Text

file
required
string <binary>

The file to translate with a maximum size of 15 megabyte (MB).

By default the following types are supported.

  • text/plain
  • application/pdf
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • application/vnd.openxmlformats-officedocument.presentationml.presentation

These files are supported in the beta stage

  • application/xliff+xml
  • application/x-xliff+xml

For OCR the following are supported.

  • image/jpeg
  • image/tiff
  • image/bmp
  • image/png
  • application/pdf
ocr
boolean
Default: false

[Experimental] This feature is only available to a selected set of users for testing.

Whether to apply optical character recognition (OCR) to the provided file.

sourceLanguage
string </^[a-z]{2}\-[A-Z]{2}$/g> (languageCode)

Language code using ISO 639-1 for language and ISO 3166-1 alpha-2 for country.

targetLanguage
required
string </^[a-z]{2}\-[A-Z]{2}$/g> (languageCode)

Language code using ISO 639-1 for language and ISO 3166-1 alpha-2 for country.

languageResources
Array of strings <uuid> (UUID) non-empty

IDs of the language resources to be used

referenceId
string

Optional field containing identifier string to help you reference the file on your system.

object

Arbitrary data. Completely up to you. Use it for anything that helps your integration work. metadata key has to be a string and has a maximum length of 256

Responses

Response samples

Content type
application/json
{
  • "file": {
    }
}

Get file information

Get detailed information on a single file

Authorizations:
OAuth2
path Parameters
id
required
string

ID of the file

Responses

Response samples

Content type
application/json
{
  • "id": "cb26237c-3beb-40f3-8e13-77d862f722b5",
  • "sourceLanguage": "en-US",
  • "targetLanguage": "de-DE",
  • "ocr": false,
  • "status": "failed",
  • "createdAt": "2021-12-31T15:00:00.000Z",
  • "updatedAt": "2021-12-31T15:00:00.000Z",
  • "referenceId": "10c73ddb-fae1-46c9-851d-40e364b121a5",
  • "metadata": {
    },
  • "errors": [
    ]
}

Download translated file

Downloads translated file. When a translated file is downloaded it would have the filename in the following format : ORIGINAL_FILE_NAME-TARGET_LANGUAGE.FILE_EXTENSION>

Authorizations:
OAuth2
path Parameters
id
required
string

ID of the file

Responses

Response samples

Content type
application/json
{
  • "errors": [
    ]
}

Term Bank

Term Bank Entity

Provides details about a specific term bank entry

Authorizations:
OAuth2
path Parameters
id
required
string

ID of the Term Bank Entity

Responses

Response samples

Content type
application/json
{
  • "conceptId": "450dd2ac76f55529e19b49b9c978956c",
  • "conceptDefinition": "Text describing term",
  • "conceptNote": "note related to the term"
}

Term Bank Associated Terms

Provides a list of terms, of the specified language, associated with an entry in the term bank.

Authorizations:
OAuth2
path Parameters
id
required
string

ID of the Term Bank Entity

query Parameters
language
required
string
Example: language=de

Associated Terms Language

Responses

Response samples

Content type
application/json
[
  • {
    }
]

License

License

Provides license information

Authorizations:
OAuth2

Responses

Response samples

Content type
application/json
{
  • "license": {
    }
}

Webhooks

Register webhook

This is used to get notifications when you have your webhook registered.

Authorizations:
OAuth2
Request Body schema: application/json

Bulk Translation input

events
required
Array of strings [ 1 .. 4 ] items
Items Enum: "text.job.done" "text.job.failed" "file.job.done" "file.job.failed"

webhook events for subscription

url
required
string

URL for recieving event, it must be secured with https://

secret
required
string

Secret of the request with the hash request

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "webhookId": "cb26237c-3beb-40f3-8e13-77d862f722b5"
}