Bulk Merge

Purpose

This API allows to merge documents in bulk. .

HTTP Request URL

https://{zohoapis_domain}/writer/api/v1/templates/{{template_id}}/bulkmerge

Path Parameters

ParameterData TypeDescription
Mandatory Parameters
template_idStringSpecify a unique id for the writer document.

Body Parameters

ParameterData TypeDescription
Mandatory Parameters
output_settings

{
  "filename":"NDA <<test>>",
  "format": "zdoc/pdf/docx",
  "password": <field_id>,
  "merge_to": "separatedoc/singledoc"
}

Using this param, you will be able to specify the following;

format -> Specify the format in which you would like to download the merged document. Supported formats are zdoc, pdf and docx.

The below key values are optional;

filename -> 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)

password -> Specify a password if you would like to protect the merged document. This key is supported only with docx and pdf files.

merge_to -> Specify in which type you would like to merge the document. Supported merge types are separatedocand singledoc

separatedoc - If you would like to merge each record as a separate document.

singledoc- If you would like to merge all the records as a single document.

By default, all the records will be merged as a single document.

You can provide the data in any one of the below formats
merge_dataJSONObjectPass a String value through 'data' key as JSON Array.
merge_data_csv_contentFileProvide the required csv content in your API request body.
merge_data_json_contentFileProvide the required json content in your API request body.
merge_data_csv_urlurlProvide the required csv url in your API request body.
merge_data_json_url urlProvide the required json url in your API request body.

Sample Request


				curl --location --request POST "https://zohoapis.com/writer/api/v1/templates/ponazfea04477109f4681a831e7177d96bc40/bulkmerge" \
  --header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
 --form 'output_settings="{'\''format'\'':'\''docx'\'', '\''password'\'':'\''***'\'','\''merge_to'\'':'\''separatedoc'\'','\''filename'\'':'\''NDA<<test>>'\''}"'
  --form "merge_data={\"data\":[{\"name\":\"Amelia\",\"email\":\"amelia@zylker.com\"}]}"			

Sample Response


				{
    
"merge_report_data_url": "http://writer.zoho.com/writer/api/v1/merge/job/0tq5n465132106580437abe99b6f56f2b0c85/data",
    
"merge_report_url": "http://writer.zoho.com/writer/v1/mailmerge/job/0tq5n465132106580437abe99b6f56f2b0c85",
"records": [
        {
	    "name": "Amelia",
            "email": "amelia@zylker.com",
            "download_link": {url},
            "status": "inprogress"
        }
    ],
}