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
| Property | Value |
|---|---|
| Method | GET |
| Request URL | https://{zohoapis_domain}/writer/api/v1/download/{{document_id}} |
| 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 | Mandatory | Specify the unique id of the document to be downloaded. |
Query Parameters
| Parameter | Data Type | Mandatory/Optional | Description |
|---|---|---|---|
| format | String | Optional | Specify 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": } | Optional | include_changes -> Specify how the track changed content needs to be reflected in downloaded file. The possible values are:
|
| sign_service_name | String | Optional | This 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. |
| password | String | Optional | Specify a password if you wish to protect the downloaded document. Note: This parameter is applicable only for docx and pdf files. |
options
| Parameter | Type | Possible Values | Default Value |
|---|---|---|---|
| include_changes | String | as_markups / all / none | none |
| include_comments | String | all / none | none |
| include_styles | String | as_inline / none | as_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;