Translate Document
Purpose
This API allows you to translate the document.
Quick Reference
| Property | Value |
|---|---|
| Method | POST |
| Request URL | https://{zohoapis_domain}/writer/api/v1/documents/{document_id}/translate |
| Scopes | ZohoWriter.documentEditor.ALL, ZohoPC.files.ALL, WorkDrive.files.ALL, WorkDrive.organization.ALL, WorkDrive.workspace.ALL |
| Rate Limit | See Writer API throttle limits |
Parameters
Path Parameters
| Parameter | Data Type | Mandatory/Optional | Description |
|---|---|---|---|
| document_id | String | Optional | Specify the unique id of the document that needs to be translated. |
Body Parameters
| Parameter | Data Type | Mandatory/Optional | Description |
|---|---|---|---|
| source_language | String | Mandatory | Specify the language code of the given original document. |
| target_language | String | Mandatory | Specify the language code in which the original document needs to be translated. |
| folder_id | String | Mandatory | Specify the ID of the folder where you'd like to store the translated document. By default, it will be saved in the "My Folder" of WorkDrive. |
Notes
- You can check the possible errors list here.
Sample Request
Copiedcurl -X POST "https://www.zohoapis.com/writer/api/v1/documents/{document_id}/translate" \
-H "Authorization: Zoho-oauthtoken <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"source_language": "en",
"target_language": "es",
"folder_id": "optional_folder_id"
}'Copiedparam = Map();
param.put("source_language","en");
param.put("target_language","fr");
param.put("folder_id","<folder_id>");
response = invokeurl
[
url :"https://www.zohoapis.com/writer/api/v1/documents/{document_id}/translate"
type :POST
parameters:param
connection:"<connection_name>"
];
info response;Sample Response
Copied{
"status_url": "https://writer.zoho.com/writer/api/v1/documents/velgx886437d3f9fa442caa6e87acd9dfad0d/translate/jobs/f931a01183b33
"status": "inprogress"
}You can check the job completion status using the 'status' key. Once the status changes to 'completed', a 'document_link' will be provided. Using which, you can access the translated document.
Copied{
"status": "completed"
"document_link":"https://writer.zoho.com/writer/open/e8447fe5069440a15042f5a92d4f20"
}