Lengoo Connect API is a RESTful HTTP API that provides a way to programmatically interface with Lengoo's translation process. It allows creating translation jobs and getting notified when they're completed and ready for delivery.
This API is available to Customers who have commercial agreements in place that allow for translation Jobs to be automatically approved.
The basic workflow consists of providing source texts, defining the Job parameters, and then either polling the Job endpoint or waiting for a webhook to fire when the translation is done.
You can add arbitrary metadata to Files and Jobs too. This is a way to store any information you might need for your integration. For example, you can use it to store the information related to the pages or blocks in your CMS that a File or a Job is about. Additionally files have an additional field for storing reference IDs to enable easy processing. That way, you don't need to run a database on your side. No particular format is enforced for that metadata.
Every HTTP call to the API requires OAuth2 authentication.
Invalid credentials result in an HTTP 401 Forbidden
error response.
A client ID and secret is required. To request for client ID and secret or decommision one reach out to your account manager or sales rep.
Base64 encode the client ID and secret using command.
echo -n clientid:clientsecret | base64
Copy value and then pass through Basic Authentication
.
Note that the scope of the request should be connect_api
.
curl --request POST \
--url https://id.lengoo.com/oauth2/aus2i12rp7MwhLcLB417/v1/token \
--header 'accept: application/json' \
--header 'authorization: Basic MG9hY...' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'grant_type=client_credentials&scope=connect_api'
Add the Token to the Authorization
header on every request made.
The Authorization type is the Bearer Token
and the value is the Token generated from the earlier request.
Example:
curl --location --request GET '{baseUrl}/api/jobs' \
--header 'authorization: Bearer eyJra...' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Spring Collection Landing Page",
"description": "Translation of the Spring Collection Landing Page on our marketing website",
"sourceLanguage": "de-AT",
"targetLanguages": ["en-US"],
"files": [
{
"id": "d7e9f332-afe2-4005-aa52-8cfd361b391c"
}
]
}'
In order to start a translation Job, it's necessary to have source texts to translate. Currently there's only one way to provide them: as files.
Upload them using the Files endpoint. That will give each file a unique URI you can use when creating a Job.
A translation Job is created by POSTing to the Jobs endpoint with the basic configuration of the Job. Afterwards, it's possible to add source files to the Job's by first uploading those files, then linking them.
The job doesn't actually start until you POST a translation request.
Once a Job is submitted for translation, it should be automatically accepted if all the details are valid. If they're not, the API returns an error 400
with more information.
In rare cases, a Job might be rejected after it's been accepted. The best way to deal with that is by getting in touch with your Lengoo Project Manager. In the future we expect to support full programmatic rejection / resubmission.
When a translation job is done or a partial delivery of a translation has occured, you can get notified about the status of the job if you have the webhook registered.
In the case where you have registered for a job.done
webhook event with an active secured URL,
you will get a request notification of the job payload when the job is completed via the url provided when you registered for the event.
If you have registered for a job.partial
webhook event with an active secured URL,
you will get a request notification of the job payload when the job has received a new translation via the registered url for the event
The secret you provide will be used to encode the payload in the X-Signature-Hmac-Sha256
header which will be in the notification request you will recieve.
The Lengoo Connect API is also available in a sandbox environment for development purposes, which doesn't trigger real translations.
Files hold the texts that are subject to translation. They can be used as input and downloaded as output after translations are done.
Upload a file. After that, it can be used in a translation Job.
Supported File Formats:
File Size Limits:
IMPORTANT: This endpoint accepts multipart forms instead of JSON.
Upload File
file required | string <binary> File formats supported: XLIFF 1.2, XLIFF 2.0, HTML5, MP4 (video), image (PNG, JPG, GIF, SVG). Maximum file size: 100 MB for MP4 files, 10 MB for other formats. |
language required | LanguageCode (LanguageCode) [ 2 .. 5 ] characters Language code: ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country, separated by dashes. |
referenceId | string <= 100 characters Optional field containing identifier string to help you reference the file on your system. |
metadata | string Arbitrary data. Completely up to you. Use it for anything that helps your integration work. |
{- "file": {
- "id": "cb26237c-3beb-40f3-8e13-77d862f722b5"
}
}
Get detailed information on a single file
id required | string ID of the source file |
{- "file": {
- "createdAt": "2021-12-31 15:00:00",
- "filename": "lord_of_the_rings.xliff",
- "language": "pt-PT",
- "referenceId": "73WakrfVbNJBaAmhQtEeDv",
- "metadata": "string"
}
}
Delete a file, as long as it isn't part of an active translation job. If it is, the request will fail with a 400 BAD REQUEST
and an appropriate error.
id required | string ID of the source file |
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
Create a job to translate content.
In a Job, all content must be in the same source language.
Source files must be uploaded separately (see section "Files").
Content can be translated to multiple target languages.
For each file the target languages can be selected, if not the file is translated to all the target languages of the job.
Target languages for each file must be available in the target languages of the job.
Due date must be a date in the future, by default at least two days in advance, during a business day. Minimum due date can be adjusted based on your operational requirements and contractual agreements.
Create job
name required | string >= 4 characters Title of the job |
sourceLanguage required | string (LanguageCode) Language code: ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country, separated by dashes. |
targetLanguages | Array of strings A list of target languages for this Job. |
dueDate | string Due date for the job. Expecting an ISO8601 UTC date string. |
Array of objects (FilesWithTargetLanguage) [ 1 .. 100 ] items Files to be translated | |
additionalInformation | string <= 5000 characters Provide additional information for the job to the Lengoo operations team. |
metadata | string Arbitrary data. Completely up to you. Use it for anything that helps your integration work. |
{- "name": "Spring Collection Landing Page",
- "sourceLanguage": "en-GB",
- "targetLanguages": [
- "de-DE",
- "pt-PT",
- "sr-Cyrl-RS"
], - "dueDate": "2021-07-15T13:00:00.000Z",
- "files": [
- {
- "id": "5ffa8704-7eb2-4fcb-a5de-23e36e0aa039",
- "targetLanguages": [
- "de-DE"
]
}
], - "additionalInformation": "string",
- "metadata": "string"
}
{- "job": {
- "id": "cb26237c-3beb-40f3-8e13-77d862f722b5"
}
}
Get a single translation job including its status.
Files contained in the job can have translations partially delivered as indicated by the deliveredLanguages
field
which will contain an array of target languages the file has been translated into and available for download.
id required | string ID of the Job |
{- "job": {
- "createdAt": "2021-12-31 15:00:00",
- "status": "submitted",
- "statusResolution": "partially_delivered",
- "name": "Spring Collection Landing Page",
- "metadata": "string",
- "sourceLanguage": "en-GB",
- "targetLanguages": [
- "de-DE",
- "pt-PT",
- "sr-Cyrl-RS"
], - "dueDate": "2021-07-15T13:00:00.000Z",
- "files": [
- {
- "id": "cb26237c-3beb-40f3-8e13-77d862f722b5",
- "referenceId": "73WakrfVbNJBaAmhQtEeDv",
- "targetLanguages": [
- "de-DE",
- "pt-PT",
- "sr-Cyrl-RS"
], - "deliveredLanguages": [
- "de-DE",
- "sr-Cyrl-RS"
]
}
], - "additionalInformation": "string"
}
}
Delete a Job, as long as it hasn't been submitted for translation yet. If it has, the request will fail with a 400 BAD REQUEST
and an appropriate error.
id required | string ID of the Job |
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
Update properties of the job. For example due date, description etc.
Due date must be a date in the future, by default at least two days in advance, during a business day. Minimum due date can be adjusted based on your operational requirements and contractual agreements.
A job can not be updated if it is already submitted.
The source language of the job can only be updated if there are no files attached.
This operation can not be used for attaching source files to the job. See Add files to job endpoint section for more operations.
id required | string ID of the Job |
Update job
name | string >= 4 characters Title of the job |
sourceLanguage | string (LanguageCode) Language code: ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country, separated by dashes. |
targetLanguages | Array of strings A list of target languages for this Job. |
dueDate | string Due date for the job. Expecting an ISO8601 UTC date string. |
additionalInformation | string <= 5000 characters Provide additional information for the job to the Lengoo operations team. |
metadata | string Arbitrary data. Completely up to you. Use it for anything that helps your integration work. |
{- "name": "Spring Collection Landing Page",
- "sourceLanguage": "en-GB",
- "targetLanguages": [
- "de-DE",
- "pt-PT",
- "sr-Cyrl-RS"
], - "dueDate": "2021-07-15T13:00:00.000Z",
- "additionalInformation": "string",
- "metadata": "string"
}
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
You can send a request for translation which locks the job data and triggers the translation flow inside lengoo.
id required | string ID of the Job |
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
This endpoint is only available in the sandbox enviroment as it exists to help test the integration with Connect API.
Sending a request to this endpoint marks specified job as done.
A done job might have three possible resolutions: delivered, cancelled or failed.
The default resolution is delivered.
id required | string ID of the Job |
Mark job as Done request body
resolution | string (JobStatusResolutionInput) The job resolution for being marked as done. The supported values are:
|
{- "resolution": "delivered"
}
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
This endpoint is only available in the sandbox enviroment as it exists to help test the integration with Connect API.
A job is considered partially delivered when at least one source file was translated for a target language.
Sending a request to this endpoint marks specified job and specified files with target languages as partially delivered.
NOTE: If all the job files and target languages are provided as input to be partially delivered, then the job is going to be marked as done.
id required | string ID of the Job |
Mark job as partially delivered
required | Array of objects [ 1 .. 100 ] items Files to be marked as partially delivered |
{- "files": [
- {
- "id": "5ffa8704-7eb2-4fcb-a5de-23e36e0aa039",
- "deliveredLanguages": [
- "de-DE",
- "pt-PT",
- "sr-Cyrl-RS"
]
}
]
}
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
Get workflow history of a job
id required | string ID of the Job |
{- "workflow": [
- {
- "createdAt": "2021-12-31 15:00:00",
- "step": "done",
- "description": null
}, - {
- "createdAt": "2021-12-26 15:05:00",
- "step": "submitted",
- "description": null
}, - {
- "createdAt": "2021-12-26 15:00:00",
- "step": "new",
- "description": null
}
]
}
Add files (see Files
for uploading files) to a job for translation.
There is a 100 files per job limitation.
Specific target languages can be specified if it exists in job target language list.
id required | string ID of the Job |
Files to add in one of the target languages of a job.
required | Array of objects (FilesWithTargetLanguage) [ 1 .. 100 ] items List of file IDs and optionally target languages |
{- "files": [
- {
- "id": "5ffa8704-7eb2-4fcb-a5de-23e36e0aa039",
- "targetLanguages": [
- "de-DE"
]
}
]
}
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
Detach file from a job but does not delete the source file itself
id required | string ID of the job |
fileId required | string ID of the source file |
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
Upload a feedback file for a specific job, source file and target language after the translation has been completed.
The feedback file must contain the corrected translation.
IMPORTANT: This feature is currently in closed beta status and only available to specific customers. Contact us if you would like to use the feature.
Supported File Formats:
File Size Limits:
id required | string ID of the job |
fileId required | string ID of the source file |
languageCode required | string Target Language code |
Upload Feedback File
file required | string <binary> File formats supported: HTML5. Maximum file size: 10. |
{- "errors": [
- {
- "key": "targetLanguage.invalid",
- "message": "Language code must be a combination of ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country."
}
]
}
This endpoint returns a list of available source language codes.
Language code: ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country, separated by dashes (e.g. "en-GB" and "sr-Cyrl-RS").
{- "languages": [
- "en-GB"
]
}
List of languages that are available for translation given a the source language.
The languages are formated as such: ISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country, separated by dashes. (e.g. "en-GB" and "sr-Cyrl-RS").
languageCode required | string Language code usingISO 639-1 for language, optionally ISO 15924 for script, and ISO 3166-1 alpha-2 for country, separated by dashes. |
{- "languages": [
- "en-GB"
]
}
Information about a job that has been completed or partially delivered.
These notifications are sent if webhooks for the events job.done
or
job.partial
were created.
{- "job": {
- "createdAt": "2021-12-31 15:00:00",
- "status": "submitted",
- "statusResolution": "partially_delivered",
- "name": "Spring Collection Landing Page",
- "metadata": "string",
- "sourceLanguage": "en-GB",
- "targetLanguages": [
- "de-DE",
- "pt-PT",
- "sr-Cyrl-RS"
], - "dueDate": "2021-07-15T13:00:00.000Z",
- "files": [
- {
- "id": "cb26237c-3beb-40f3-8e13-77d862f722b5",
- "referenceId": "73WakrfVbNJBaAmhQtEeDv",
- "targetLanguages": [
- "de-DE",
- "pt-PT",
- "sr-Cyrl-RS"
], - "deliveredLanguages": [
- "de-DE",
- "sr-Cyrl-RS"
]
}
], - "additionalInformation": "string"
}
}
This is used to get notifications when you have your webhook registered.
Webhook registeration payload
events required | Array of strings [ 1 .. 4 ] items Items Enum: "job.done" "job.partial" 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 |
{- "events": [
- [
- "job.done"
]
], - "secret": "string"
}
{- "webhookId": {
- "id": "cb26237c-3beb-40f3-8e13-77d862f722b5"
}
}