Upload and Translate a Document
POST {{baseUrl}}/document
This call uploads a document and queues it for translation.
The call returns once the upload is complete, returning a document ID and key which can be used to
:apiDocsLink[query the translation status]{operationId=getDocumentStatus}
and to :apiDocsLink[download the translated document]{operationId=downloadDocument} once translation is complete.
Because the request includes a file upload, it must be an HTTP POST request with content type multipart/form-data
.
Please be aware that the uploaded document is automatically removed from the server once the translated document has been downloaded.
You have to upload the document again in order to restart the translation.
The maximum upload limit for documents is available here
and may vary based on API plan and document type.
You may specify the glossary to use for the document translation using the glossary_id
parameter.
Important: This requires the source_lang
parameter to be set and the language pair of the glossary has to match the language pair of the request.
Request Body
[{"name"=>"target_lang", "value"=>"DE", "datatype"=>"string"}, {"name"=>"file", "value"=>nil, "datatype"=>"null"}, {"name"=>"source_lang", "value"=>"", "datatype"=>"null"}, {"name"=>"filename", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"formality", "value"=>"default", "datatype"=>"string"}, {"name"=>"glossary_id", "value"=>"<string>", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"document_id":"\u003cstring\u003e","document_key":"\u003cstring\u003e"}