APIBeta
Documents

Pre-translate a document

POST
/v1/documents/{id}/translations

Fills the segments of some translations of the document with a pre-translation: first from the translation memories of the team, then with a machine translation, as each language asks. The document must be INDEXED, and each language must be one the document is translated into, with the status CREATED and not complete yet.

The call is all or nothing: when one language cannot be pre-translated, nothing starts and the error names it.

The pre-translation runs in the background. The answer holds the translations of the document, where the languages of this call are PRE_TRANSLATING. Poll the self link, the same list as GET /v1/documents/{id}/translations, every 10 to 30 seconds: a language is done when it is back to CREATED, with its new progress.

A language can be in one pre-translation at a time, and the account of the key can run 2 pre-translations at once. Past either limit the call answers 409: retry when a running pre-translation ends.

Authorization

apiKey
headerAuthorizationBearer <token>

The key the team leader created in Redokun, sent as Authorization: Bearer rdk_.... A read key is rejected on every call that writes (any method other than GET, HEAD or OPTIONS).

Path Parameters

id*integer

Identifier of the document

Range1 <= value <= 2147483647

Request Body

application/json
  1. body

The languages to pre-translate and how to save what the pre-translation fills. An unknown property is refused

languages*array<>

The languages to pre-translate, each once

Items1 <= items <= 50
useIdenticalMatches?boolean

In the translation memory step, also use the matches that are identical in text but come from another context. Without it the step uses only the matches with the same text and the same context

Defaultfalse
identicalMatchesAsDraft?boolean

Save the identical matches as drafts, for a translator to review. When false they are saved as confirmed

Defaulttrue
machineTranslationsAsDraft?boolean

Save the machine translations as drafts, for a translator to review. When false they are saved as confirmed

Defaulttrue
toneOfVoice?|

The tone of the machine translations, when the vendor supports it. Absent for the default of the vendor

Value in"NEUTRAL""FORMAL""INFORMAL"

Response Body

The pre-translation is queued. The translations of the document, where its languages are PRE_TRANSLATING

application/json
  1. response
translations*array<>

One for each language the document is translated into, oldest first. Empty while a new revision of the document is being indexed

links*array<>

The resources related to this one. Follow these links instead of building the URLs yourself, so a change of path does not break the client

Example Request
curl -X POST 'https://api.redokun.com/v1/documents/1/translations' \  -H 'Content-Type: application/json' \  -d '{  "languages": [    {      "code": "it-IT",      "translationMemory": true,      "machineTranslation": true,      "machineTranslationVendor": "DEEPL"    },    {      "code": "de-DE",      "translationMemory": true    }  ],  "useIdenticalMatches": true,  "identicalMatchesAsDraft": true,  "machineTranslationsAsDraft": true,  "toneOfVoice": "FORMAL"}'
Example Response
{  "translations": [    {      "id": 0,      "language": {        "name": "string",        "code": "string"      },      "status": "CREATED",      "progress": {        "totalSegments": 0,        "translatedSegments": 0,        "confirmedSegments": 0,        "draftSegments": 0,        "completedPercentage": 0.1      },      "translators": [        {          "id": 0,          "fullName": "string",          "email": "string",          "inviteStatus": "INVITED"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "links": [        {          "rel": "string",          "href": "string"        }      ]    }  ],  "links": [    {      "rel": "string",      "href": "string"    }  ]}