Sign Mail Merge
Purpose
To send a mail merge document for signing and approval.
To use this API, you must initially access the Merge and Sign dialogue from the Writer UI once. Please note that you need to do this only once.
Request Details
Request URL
{api-domain}/crm/{version}/{module_API_name}/{record_id}/actions/sign_mail_merge
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.settings.mailmerge.CREATE,ZohoWriter.documentEditor.ALL,ZohoWriter.merge.ALL,ZohoSign.documents.ALL
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v6/Leads/554023000003128089/actions/sign_mail_merge"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@input.json"
-X POST
Input JSON
- mail_merge_templateJSON object, mandatory
- name string, mandatory
The name of the mail merge template you want to use.
- file_namestring, mandatory
The name of the file you want to send for signing and approval.
- sign_in_orderBoolean, optional
The value true indicates that the document will first be sent for approval and then for signing.
- signersJSON array, optional
The details of the users you want to sign the document.
- recipient_name,string, mandatory - the name of the user who has to sign or approve the document.
- action_type,string, mandatory - the type of action you want the user to perform. The possible values are sign to sign the document, and approve to approve the document.
- recipient,JSON object, mandatory
- value,string, mandatory - the email ID of the user who has to sign or approve the document.
Note
- The values for the fields "recipient_name", "recipient.value" will be taken from the mail merge template. If you want to override the values in the template, you must specify the values of these fields in the input body.
Sample Input
Copied{
"sign_mail_merge": [
{
"mail_merge_template": {
"name": "mailmergename"
},
"file_name": "testdocument",
"sign_in_order": true,
"signers": [
{
"recipient_name": "Smith",
"action_type": "sign",
"recipient": {
"type": "email",
"value": "smith@gmail.com"
}
},
{
"recipient_name": "John",
"action_type": "approve",
"recipient": {
"type": "email",
"value": "john@gmail.com"
}
},
{
"recipient_name": "John",
"action_type": "approve",
"recipient": {
"type": "merge_field",
"value": "${!Leads.Last_Name}"
}
}
]
}
]
}
Possible Errors
- EXPECTED_FIELD_MISSINGHTTP 400
You have not specified the name in the "mail_merge_template" key.
Resolution: You must specify the name of the mail merge template in the "mail_merge_template" key. - INVALID_DATAHTTP 400
You have specified an incorrect name of the mail merge template.
Resolution: Provide the right name of the mail merge template. - INVALID_EMAILHTTP 400
You have specified an incorrect email address for the "recipient" field.
Resolution: The email ID must belong to only the org-approved CRM users or the current user. - INVALID_DATAHTTP 400
You have specified an incorrect record ID in the URL.
Resolution: Provide the right record ID in the URL. Use the Get Records API to get the record ID. - INVALID_MODULEHTTP 400
The module name is invalid.
Resolution: Use the Modules API to get the API name of the module. - MANDATORY_NOT_FOUNDHTTP 400
You have not specified one or more mandatory keys in the request.
Resolution: Refer to the Input JSON section for the list of mandatory keys. - INVALID_REQUEST_METHODHTTP 400
The HTTP request method is invalid.
Resolution: The HTTP request method for this API is POST. - INTERNAL_ERRORHTTP 500
Unhandled exception in server.
Resolution: Contact the support team at support@zohocrm.com.
Sample Response
Copied{
"code": "SUCCESS",
"details": {
"report_link": "https://writer.zoho.com/report_link"
},
"message": "sign mail merge action initiated successfully",
"status": "success"
}