Translate Document

Purpose

This API allows you to translate the document.

Quick Reference

PropertyValue
MethodPOST
Request URLhttps://{zohoapis_domain}/writer/api/v1/documents/{document_id}/translate
ScopesZohoWriter.documentEditor.ALL, ZohoPC.files.ALL, WorkDrive.files.ALL, WorkDrive.organization.ALL, WorkDrive.workspace.ALL
Rate LimitSee Writer API throttle limits

Parameters

Path Parameters

ParameterData TypeMandatory/OptionalDescription
document_idStringOptionalSpecify the unique id of the document that needs to be translated.

Body Parameters

ParameterData TypeMandatory/OptionalDescription
source_languageStringMandatorySpecify the language code of the given original document.
target_languageStringMandatorySpecify the language code in which the original document needs to be translated.
folder_idStringMandatorySpecify 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"
}