Download Document

The Writer API allows to download docs that are stored in your Writer account. You can download files in docx, odt, rtf, txt, html, pdf, zip, epub, zdoc and pdfform formats. To download a document, you should make an authorized HTTP GET request by including the document_id and format parameters. The document will be downloaded in docx format by default if you don't specify this parameter in your API request.

Purpose

To download the document in the specified format.

Quick Reference

PropertyValue
MethodGET
Request URLhttps://{zohoapis_domain}/writer/api/v1/download/{{document_id}}
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_idStringMandatorySpecify the unique id of the document to be downloaded.

Query Parameters

ParameterData TypeMandatory/OptionalDescription
formatStringOptionalSpecify the format in which the document needs to be downloaded. By default, the document will be downloaded in 'docx' format.
Supported file formats -> zdoc, docx, odt, rtf, txt, html, pdf, zip, epub, and pdfform.
options{
"include_changes":<String>,
"include_comments":<String>, "include_styles":<String>
},
"include_comments":, "include_styles":
}
Optional

include_changes -> Specify how the track changed content needs to be reflected in downloaded file. The possible values are:
- as_markups: If the marked up content needs to be included in downloaded document.
- all: To download the file by accepting all the track changes done.
- none: To download the document by rejecting the track changes done.


include_comments -> Specify if the comments needs to be included in the downloaded file or not. The possible values are:
- all: To download the file with the comments.
- none: To download the document without the comments.
Note: This parameter is applicable only for docx and pdf files.


include_styles-> Specify if the styles needs to be included in the downloaded file or not. The possible values are:
- as_inline: To download the file along with inline styles. This will help to retain the font colors, font sizes and other styles from the document.
- none: To download the document without any styles. This will only retain the heading tags (H1, H2 etc), basic formatting and hyperlinks.
Note: This parameter is applicable only for html and zip files.

sign_service_nameStringOptionalThis param needs to be configured when you would like to upload the downloaded document with signer fields to a third party sign service.
Possible values: zohosign, adobesign and docusign.
Default value for this param will be zohosign.
Note: This param can be used only when the 'format' param value is configured as pdf.
passwordStringOptionalSpecify a password if you wish to protect the downloaded document.
Note: This parameter is applicable only for docx and pdf files.

options

ParameterTypePossible ValuesDefault Value
include_changesStringas_markups / all / nonenone
include_commentsStringall / nonenone
include_stylesStringas_inline / noneas_inline

Notes

  • The comments present in the document will be reflected in the downloaded document based on the comment visibility permission provided for that particular document.
  • For possible errors, refer to error codes.

Sample Request

Copiedcurl -X GET "https://www.zohoapis.com/writer/api/v1/download/{document_id}?format=pdf" \
  -H "Authorization: Zoho-oauthtoken <ACCESS_TOKEN>"
Copiedparam = Map();
param.put("format","pdf");
response = invokeurl
[
	url :"https://www.zohoapis.com/writer/api/v1/download/{document_id}"
	type :GET
	parameters:param
	connection:"<connection_name>"
];
info response;

Sample Response

The document will be downloaded in the specified format.