Merge Document
Purpose
This API will allow you to generate documents and merge them.
HTTP Request URL
https://{zohoapis_domain}/writer/api/v1/documents/{{document_id}}/merge
Path Parameters
Parameter | Data Type | Description |
Mandatory Parameters | ||
document_id | String | Specify a unique id for the writer document. |
Body Parameters
Parameter | Data Type | Description |
Mandatory Parameters | ||
output_format | String | Specify a format in which you would like to download the merged document.
Supported formats are pdf, pdfform, docx, html, zfdoc and zip (only html). |
You can provide the data in any one of the below formats | ||
merge_data | JSONObject | Pass a String value through 'data' key as JSON Array. |
merge_data_csv_content | File | Provide the required csv content in your API request body. |
merge_data_json_content | File | Provide the required json content in your API request body. |
merge_data_csv_url | url | Provide the required csv url in your API request body. |
merge_data_json_url | url | Provide the required json url in your API request body. |
record_id | String | Instead of using merge_data, you can pass the record_id and we will fetch the data internally. Note: This is applicable only for Zoho CRM, Creator, Recruit and Bigin templates. Maximum length allowed: 25 |
Optional Parameters | ||
password | String | Specify a password if you would like to protect the merged document. |
response_type | String | Specify the response_type value as "link" to download the document using a link. |
filename | String | Specify a name (without extension) for the merged document that needs to be downloaded.
For example: "filename = test" (extension will be automatically added based on the provided 'output_format') |
sign_service_name | String | This param needs to be configured when you would like to upload the merged document with signer fields to a third party sign service.
Possible values: adobesign and docusign
Note: This param can be used only when the 'output_format' param value is configured as pdf. |
test_mode | Boolean (true/false) | Using this param, you can test the Merge APIs without consuming any credit points. The output file will contain a watermark as it is used only for testing purpose.
Test mode limit: 50 merges/day for an org. |
Note:
- To merge documents with more than one record, you can use our Bulk Merge API.
- The download URL generated in the output response will expire after two days.
Curl - Sample Request
Copiedcurl --location --request POST "https://www.zohoapis.com/writer/api/v1/documents/ponazfea04477109f4681a831e7177d96bc40/merge" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form "output_format=pdf" \
--form "password=***" \
--form "merge_data={\"data\":[{\"name\":\"Amelia\",\"email\":\"amelia@zylker.com\"}]}"
Deluge Snippet
Copieddata = Map();
data.put("InvoiceNo","12345");
data.put("InvoiceDate","27 May 2022");
data.put("InvoiceAmount","$100");param = Map();
param = Map();
param.put("merge_data",{"data":data});
param.put("output_format","pdf");
param.put("response_type","link");
info param;
email = "amelia@zylker.com";
response = invokeurl
[
url: "https://www.zohoapis.com/writer/api/v1/documents/olce2ef*****e46ed8331f25aaece75dd/merge"
type:POST
parameters:param
connection:"<connection_name>"
];
info response;
The document will be downloaded in the form of bytes.
If the 'response_type' parameter is passed, the response will be as the following: