Pre-translate a document
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.
apiKeyAuthorizationBearer <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).
id*integerIdentifier of the document
1 <= value <= 2147483647application/json- 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
1 <= items <= 50useIdenticalMatches?booleanIn 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
falseidenticalMatchesAsDraft?booleanSave the identical matches as drafts, for a translator to review. When false they are saved as confirmed
truemachineTranslationsAsDraft?booleanSave the machine translations as drafts, for a translator to review. When false they are saved as confirmed
truetoneOfVoice?|The tone of the machine translations, when the vendor supports it. Absent for the default of the vendor
"NEUTRAL""FORMAL""INFORMAL"The pre-translation is queued. The translations of the document, where its languages are PRE_TRANSLATING
application/json- 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
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"}'{ "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" } ]}A document of the team GET
An id that belongs to an older revision of the document answers 303 and points to the latest revision. Most HTTP clients follow it on their own, so the document you get may have another `id` than the one you asked for: compare them when the revision matters to you. Following the redirect is a second call, and counts against the rate limit like any other.
The translations of a document GET
The status and the progress of each language the document is translated into. Poll it while a pre-translation or a review is in progress, and go on when each language reaches the status you wait for. Poll every 10 to 30 seconds. A pre-translation fills the segments in steps, so `completedPercentage` does not grow smoothly: it jumps at the end of the translation memory step and at the end of the machine translation step. Each revision of the document has its own translations. The first upload of a document has them from the start, with no segments until the document is `INDEXED`: wait for that status of the document before you read the progress. A new revision has none until its indexing copies them from the previous revision, so until then the list is empty. The list is not paginated: all the translations are shown in one response. An id that belongs to an older revision of the document answers 303 and points to the translations of the latest revision. Following the redirect is a second call, and counts against the rate limit like any other.