Update document in Zoho Sign
Table of Contents
Note:
- Each time the zoho.sign.updateDocument integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.sign.updateDocument integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
The zoho.sign.updateDocument task is used to update a document in Zoho Sign. This task is based on the Zoho Sign API - Update Document.
Syntax
<response> = zoho.sign.updateDocument(<document_id>, <values_map>, <connection>);
where:
| Params> | Data type | Description |
| <response> | KEY-VALUE | The response returned by Zoho Sign that contains the information of the updated document. |
| <document_id> | NUMBER | The ID of the document that will be updated. |
| <values_map> | KEY-VALUE | New values of the document that will be updated. Note: The keys to this param need to be given as specified in Zoho Sign API. |
| <connection> | TEXT | The link name of the Zoho Sign connection. Note:
|
Example 1: Insert a new file into a Zoho Sign document
The following script inserts a file to the specified Zoho Sign document:
// Fetch file from cloud pdf_file = invokeUrl [ url: "http://www.africau.edu/images/default/sample.pdf" type: GET ]; // Construct a map to hold values_map = Map(); values_map.put("file", pdf_file); // Perform update document task to insert the file to the Zoho Sign document info zoho.sign.updateDocument(10696000000040001, values_map);
where:
response
10696000000040001
values_map
Example 2: Add recipients to the specified Zoho Sign document
The following script adds the specified recipient to the specified Zoho Sign document:
recipient1 = Map(); recipient1.put("recipient_name","Hailee"); recipient1.put("recipient_email","hailee@zylker.com"); recipient1.put("action_type","VIEW"); recipient2 = Map(); recipient2.put("recipient_name","Kate"); recipient2.put("recipient_email","kate@zylker.com"); recipient2.put("action_type","SIGN"); recipient_list = List(); recipient_list.add(recipient1); recipient_list.add(recipient2); actions_map = Map(); actions_map.put("actions", recipient_list); request_map = Map(); request_map.put("requests", actions_map); field_map = Map(); field_map.put("data", request_map); response = zoho.sign.updateDocument(120761000000039013, field_map);
where:
field_map
Response Format
Success Response
The success response will be returned in the following format:
{
"code": 0,
"requests": {
"request_status": "draft",
"notes": "",
"attachments": [
],
"reminder_period": 5,
"owner_id": "10696000000009003",
"description": "",
"request_name": "sample_test1243",
"modified_time": 1588835162035,
"is_deleted": false,
"expiration_days": 15,
"is_sequential": false,
"owner_first_name": "Shawn",
"request_view_url": "https://sign.zoho.com/zs#/request/viewer/10696000000038001?internal=true",
"sign_percentage": 0,
"owner_email": "shawn@zylker.com",
"created_time": 1580808869623,
"email_reminders": true,
"document_ids": [
{
"document_name": "sample.pdf",
"document_size": 2953,
"document_order": "0",
"total_pages": 2,
"document_id": "10696000000038002"
},
{
"document_name": "dummy.pdf",
"document_size": 13227,
"document_order": "1",
"total_pages": 1,
"document_id": "10696000000038005"
},
{
"document_name": "sample.pdf",
"document_size": 2953,
"document_order": "2",
"total_pages": 2,
"document_id": "10696000000049001"
}
],
"self_sign": false,
"request_edit_url": "https://sign.zoho.com/zs#/request/new/10696000000038001?internal=true",
"request_url": "https://sign.zoho.com/zs#/request/new/10696000000038001?internal=true",
"in_process": false,
"validity": -1,
"request_type_name": "Others",
"request_id": "10696000000038001",
"request_type_id": "10696000000000187",
"owner_last_name": "Shawn",
"actions": [
{
"verify_recipient": false,
"is_bulk": false,
"action_id": "10696000000049032",
"action_type": "VIEW",
"recipient_email": "shawn@zylker.com",
"signing_order": -1,
"send_completed_document": true,
"recipient_name": "Shawn",
"allow_signing": false,
"action_status": "NOACTION",
"recipient_phonenumber": "",
"recipient_countrycode": ""
},
{
"verify_recipient": false,
"action_type": "SIGN",
"recipient_email": "shawn@zylker.com",
"send_completed_document": true,
"allow_signing": true,
"recipient_phonenumber": "",
"is_bulk": false,
"action_id": "10696000000049016",
"signing_order": -1,
"fields": [
],
"recipient_name": "Shawn",
"action_status": "NOACTION",
"recipient_countrycode": ""
},
{
"verify_recipient": false,
"is_bulk": false,
"action_id": "10696000000049042",
"action_type": "VIEW",
"recipient_email": "hailee@zylker.com",
"signing_order": -1,
"send_completed_document": true,
"recipient_name": "Shawn",
"allow_signing": false,
"action_status": "NOACTION",
"recipient_phonenumber": "",
"recipient_countrycode": ""
}
],
"attachment_size": 0
},
"message": "Document has been updated",
"status": "success"
}
Failure Response
The failure response for incorrect document ID will be returned in the following format:
{
"code":4003,
"message":"Access to view the document is denied",
"status":"failure"
}The failure response when this task is used to upload a file to a document that is already sent for signing will be returned in the following format:
{
"code":2005,
"message":"Unable to upload the document",
"status":"failure"
}