E-Sign lets your subscribers send documents for electronic signing using a designated Send for E-Sign button, which can be placed on any page you decide.This feature is provided by integrating with Zoho Sign using various developer tools offered by Zoho Vertical Solutions. We'll walk you through the entire process, outlining each step in detail.
In this document we will provide a detailed step-by-step guide for implementing E-Sign for your solutions. For a deeper understanding of the functionalities of E-Sign, please refer to
this document.
Step 1 : Create the custom modules for the E-Sign implementation
Custom modules are required for storing and managing data related to the document signing process within your solution. By creating custom modules specifically tailored for E-Sign functionality, you can ensure efficient organization and retrieval of relevant information.
The
Sign Documents, Sign Recipients, and
Sign Document Events modules are used for storing information regarding the documents to be signed, recipients involved in the signing process, and events related to document signing activities, respectively. Begin the implementation step by creating these custom modules, with the relevant custom fields in each. Refer to our
help documentation for detailed guidance on how to create custom modules.
a. Sign Documents
The Sign Documents module is used for storing details about the documents to be signed, including document names, descriptions, statuses, and deadlines. Refer to the table below for a breakdown of the module's fields.
Please note that you need to add lookup fields to all the modules where you need the E-Sign functionality.
Sl. No: | Field Label | Data Type | Remarks |
01 | Sign Documents Image | profileimage | Standard |
02 | Sign Documents Name | text | Standard |
03 | Sign Documents Owner | ownerlookup | Standard |
04 | Created By | ownerlookup | Standard |
05 | Modified By | ownerlookup | Standard |
06 | Contacts | lookup
Lookup Module : Contacts Related List Title : ZohoSign Documents | Custom |
07 | Created Time | datetime | Standard |
08 | Last Activity Time | datetime | Standard |
09 | Quotes | lookup Lookup Module : Quotes Related List Title : Sign Documents | Custom |
10 | Tag | Text | Standard |
11 | Date Declined | Date | Custom |
12 | Date Sent | Date | Custom |
13 | Declined Reason | Textarea | Custom |
14 | Document Deadline | Date | Custom |
15 | Document Status | Text | Custom |
16 | Document Description | Textarea | Custom |
17 | Document Note | Textarea | Custom |
18 | Sign Document_ID | Text | Custom |
19 | Sign Request_ID | Text | Custom |
20 | Is Sign Reminder Sent | Boolean | Custom |
21 | Number of Sign Reminder Sent | Text | Custom |
22 | Modified Time | Datetime | Standard |
23 | Unsubscribed Time | Datetime | Standard |
b. Sign Recipients
The Sign Recipients module stores information about the recipients involved in the signing process, such as their names, email addresses, and signing statuses. Refer to the table below for details on the module's fields.
Sl No: | Field Label | Data Type | Remarks |
01 | Sign Recipients Image | profileimage | Standard |
02 | Sign Recipients Name | text | Standard |
03 | Email | email | Custom |
04 | Date Completed | date | Custom |
05 | Recipient Status | picklist Picklist Values
None, Sent, Signed, Declined, Mailed
| Custom |
06 | Date Declined | date | Custom |
07 | Recipient Type | picklist Picklist Values SIGN, VIED, INPERSON SIGN | Custom |
08 | Sign Recipients Owner | ownerlookup | Standard |
09 | Date Delivered | date | Custom |
10 | Modified By | ownerlookup | Standard |
11 | Modified Time | datetime | Standard |
12 | Created Time | datetime | Standard |
13 | Declined Reason | text | Custom |
14 | Last Activity Time | datetime | Standard |
15 | Sign Document | lookup Lookup Module : ZohoSign_Documents Related List Title : Sign Recipients | Custom |
16 | Tag | text | Standard |
17 | Created By | ownerlookup | Standard |
18 | Unsubscribed Time | datetime | Standard |
19 | Sign Docuement_ID | text | Custom |
20 | Recipient Order | text | Custom |
b. Sign Document Events
The Sign Document Events module stores events related to document signing activities, providing a track of actions performed throughout the signing process. Refer to the table below for details on the module's fields.
Sl No: | Field Label | Data Type | Remarks |
01 | Sign Document Events Image | profileimage | Standard |
02 | Sign Document Events Name | text | Standard |
03 | Sign Document Events Owner | ownerlookup | Standard |
04 | Sign Documents | date | Custom |
05 | Recipient Status | lookup Lookup Module : ZohoSign_Documents Related List Title : Sign Document Events | Custom |
06 | Modified By | ownerlookup | Standard |
07 | Sign Recipients | lookup Lookup Module : ZohoSign_Recipients Related List Title : Sign Document Events | Custom |
08 | Created Time | datetime | Standard |
09 | Last Activity Time | datetime | Standard |
10 | Date | date | Custom |
11 | Tag | text | Standard |
12 | Created By | ownerlookup | Standard |
13 | Modified Time | datetime | Standard |
14 | Unsubscribed Time | datetime | Standard |
15 | Description | text | Custom |
Step 2: Create and establish the Connector
Connectors facilitate the integration process between solutions built on the Vertical Solution platform and third-party applications via the OAuth 2.0 protocol.
For ease of understanding, we will outline the connector configuration specific to Vertical Sign product. Henceforth, we will stick to the term Vertical Sign for the rest of the document.
By creating and establishing a connector for Vertical Sign or Zoho Sign, you enable your solution to communicate with the Vertical Sign securely. The connector facilitates authentication and authorization processes, ensuring that data exchanges between your solution and Vertical Sign are encrypted and protected.
To enable Vertical Sign integration, follow these steps for creating a connector:
- Log in to the Zoho Developer Console and navigate to Vertical Solutions.
- Choose the application you wish to modify and select Edit.
- Access Connectors under Utilities.
- Click on Create Connector.
- Specify an appropriate name and description for the connector.
- Name the third-party service. For example, "ESign."
- Provide the signup URL for the third-party service.
- Input the necessary URLs for generating the Auth token. In the URLs given below, Replace {{portal-id}} with your portal ID. To get your Portal ID, Go to Set Up > Developer Space > APIs and click on the ? > API Console. The API console URL has the Portal ID in the format https://{{your_solution_name}}.zohoplatform.com/accounts/console/user/{{portal_id}}
- Request Token URL: https://accounts.zohoportal.com/clientoauth/v2/{{portal-id}}/auth?scope=ZohoSign.documents.ALL,ZohoSign.account.ALL,ZohoSign.setup.ALL,ZohoSign.templates.ALL&access_type=offline&prompt=consent
- Access Token URL: https://accounts.zohoportal.com/clientoauth/v2/{{portal-id}}/token?scope=ZohoSign.documents.ALL,ZohoSign.account.ALL,ZohoSign.setup.ALL,ZohoSign.templates.ALL&access_type=offline&prompt=consent
- Refresh Token URL: https://accounts.zohoportal.com/clientoauth/v2/{{portal-id}}/token?scope=ZohoSign.documents.ALL,ZohoSign.account.ALL,ZohoSign.setup.ALL,ZohoSign.templates.ALL&access_type=offline&prompt=consent
- Revoke Token URL: https://accounts.zohoportal.com/clientoauth/v2/{{portal-id}}/token?scope=ZohoSign.documents.ALL,ZohoSign.account.ALL,ZohoSign.setup.ALL&access_type=offline&prompt=consent
- Choose whether to revoke authorization using the Access token or the refresh token.
- Click Save.
Upon successful creation, you will see a window displaying the redirect URL for the client. Here, you need to input the client credentials for Vertical Sign.
2.2. Create a Server-Based Client
In this step, you should create a server-based client in your API console, and use the redirect URL provided in the previous step and the redirect URI for the client.
- Click the API Console button located in the top right corner.
- To create a new server-based client, click +ADD CLIENT > Server Based Applications. Enter the following details:
- Client name: Provide a client name for identification purposes.
- Homepage URL.
- Authorized Redirect URIs: Use the redirect URI obtained from the previous step after connector creation.
- Click CREATE.
Upon successful client creation, you will receive the client ID and client secret. Copy these credentials and input them into the client details window obtained in the previous step.
2.3. Authorise the Connector
Once you have created the connector, it will need to be authorized. By authorizing the connector, you grant it permission to perform specific actions and access data within the specified scope
To authorize your connector,
- In the Connectors page of your Zoho developer, click the Authorize link next to the connector you are working on.
- If you are not already logged in, you will be prompted to do so. Login with user credentials.
- Once you are logged in, the authorization window will display the access permissions for the connector.
- Click Allow.
Your connector will now be authorized.
2.3 Add APIs
After creating your connector, specify the actions it can execute by adding an API for each action. For the Vertical Sign feature, we will utilize
Zoho Sign APIs to perform tasks such as adding a document, sending a document for ESign, or sending a reminder. These APIs are to be invoked by the widgets using the JS SDK methods of Zoho CRM, or any other methods that fit your development environment.
To add the APIs,
- Navigate to Connectors under Utilities.
- Click Edit on the connector created for the Vertical Sign implementation.
- Click on Create Connector API.
- For each API, provide the following details:
- Name of the connector API
- Method type
- API URL
- Headers
- Click Create.
To add more APIs, repeat steps 4 and 5 by clicking on
Create API. The following are the basic APIs you need to add for the Vertical Sign implementation. You may add more APIs to implement your business requirements, from the
Zoho Sign APIs.
Sl. No | API Name & Purpose | API URI | Method | Headers |
1 | To update an existing document | http://{{solution-name}}.sign.zohoplatform.com/api/v1/requests/${reqId} | PUT | NA |
2 | | http://{{solution-name}}.sign.zohoplatform.com/api/v1/requests | POST | NA |
3 | | http://{{solution-name}}.sign.zohoplatform.com/api/v1/requests/${reqId}/submit?data=${data} | POST | NA |
4 | | http://{{solution-name}}.sign.zohoplatform.com/api/v1/requests/${reqId}/documents/${docId}/pdf | GET | NA |
5 | | http://{{solution-name}}.sign.zohoplatform.com/api/v1/requests/${request_id}/completioncertificate | GET | NA |
6 | | http://{{solution-name}}.sign.zohoplatform.com/api/v1/requests/${reqId}/${remind} | POST | NA |
After adding the required APIs,
publish your connector by clicking on the Publish button in the top right corner of the connector window, and take a note of the extension URL you get after publishing the connector.
2.4 Associate Connector
In this step, you need to associate the connector that you just created with the Vertical Sign app. This step ensures that the connector is recognized and authorized to access Vertical Sign resources within your solution. Although this is a one-time process, if you update the connector, you should publish the connector again and repeat this step.
To associate the connector,
- Access Connectors under Utilities.
- Select the Associated Connectors tab. All the published connectors will be listed.
- Select the Connector
- Click on Add
Every time you update the connector, or update one or more of the added APIs, you should publish the connector, and update the same in the Associated Connectors section. To do this,
- Access Connectors under Utilities.
- Select the Associated Connectors tab.
- Hover over the connector name, and click on View All APIs.
- Click on the Update button on the top.
Step 3 : Connected App
A Connected App helps you integrate your solution with various applications via APIs. This integration enables you to incorporate the functionalities provided by external applications, thereby enhancing the feature set of your solution. In this step, you will create a connected app (widget) for the Vertical Sign implementation. By creating a connected app for Vertical Sign, you provide users with a user-friendly interface for initiating document signing processes.
Create the widget to fit your specific business requirements. Although the basic functionality of Vertical Sign involves sending documents for E-Sign, sending reminders, revoking documents, and downloading the completion certificate, you can implement many more functionalities utilising the Zoho Sign APIs. Use the
JS SDK methods of Zoho CRM to invoke the Connector and the APIs added within the connector. Click
here to learn Invoking Connectors and its APIs via JS SDK Methods.
To create a connected app,
- Click on Connected Apps from Utilities
- Enter the following details to create the connected app:
- Connected App Name
- Description
- Choose the hosting as External or Internal, depending on your requirement. You need to specify the domain details of the server where your application is hosted. For internal hosting, specify the base URL of your app and upload the zip file. Refer here to know more about Internal hosting. For external hosting, specify the Base URL for both Sandbox and Production.
- Check the Modifiable check-box if you want your connected app to be editable.
- Click on Save
Step 4 : Add necessary functions to be invoked as REST API
Define standalone functions to be invoked as REST API, to implement functionalities pertaining to Vertical Sign. For instance, define functions to get the mail merge templates in the account or to get the mail merge document, and invoke them from the widget for the specific functionality.
To add the functions,
- From the Solution home page, click on Automate > Functions
- Click on New Function
- In the Create Function page, specify the following details:
- Function Name
- Invoke as REST API > YES
- Specify the return type for the function
- Click Next
- In the function editor, define your function, and click on Save & Close.
Repeat these steps for all the custom functions that you want to invoke from your widget. Click on the Invoke as REST API button in the editor window to get the Sandbox and Production invoke URLs for the function. These functions should be invoked using the execute method of the JS SDK:
ZOHO.CRM.FUNCTIONS.execute( function namespace, params).then(function (data) {console.log(data);})
The following are the basic functions you need to define for the Vertical Sign functionality.
getMMtemplates - To get the mail merge templates available in the account, for the corresponding module from where the function is invoked. Given below is a sample code for this function. Feel free to make changes according to your specific requirements.
- moduleName = crmAPIRequest.get("params").get("module");
- tempList = zoho.crm.getTemplates(moduleName);
- return tempList;
getMergeFile - To get the merged files. Given below is a sample code for this function. Feel free to make changes according to your specific requirements.
- moduleName = crmAPIRequest.get("params").get("module");
- recordId = crmAPIRequest.get("params").get("recordId");
- fileName = crmAPIRequest.get("params").get("fileName");
- mailMerge_templateId = crmAPIRequest.get("params").get("templateId");
- info "ModuleName :: " + moduleName;
- info "templateId :: " + mailMerge_templateId;
- mergeFile = zoho.crm.getMergedFile(moduleName,recordId,mailMerge_templateId);
- getPrefixName = fileName.getPrefix('.');
- checkExtension = fileName.getSuffix(".");
- info mergeFile;
- info getPrefixName;
- info checkExtension;
- if(checkExtension == "zdoc")
- {
- newFileName = getPrefixName + ".docx";
- info newFileName;
- mergeFile.setFileName(newFileName);
- }
- else
- {
- info fileName;
- mergeFile.setFileName(fileName);
- }
- mergeFile.setParamName("content");
- info mergeFile;
- filesMap = Map();
- filesMap.put("file",mergeFile);
- dynamic_map = Map();
- dynamic_map.put("CRMAPIFILES",filesMap);
- info dynamic_map;
- uploadFileResp = zoho.crm.invokeConnector("esignv2.uploadfile",dynamic_map);
- info uploadFileResp;
- return uploadFileResp;
sendEreminder - To send reminders for E-sign to all the recipients. Given below is a sample code for this function. Feel free to make changes according to your specific requirements.
- signDocRecId = sign_documents.get("ZohoSign_Documents.ID");
- //signDocRecId = "4479873000000274065";
- info signDocRecId;
- recDetails = zoho.crm.getRecordById("ZohoSign_Documents",signDocRecId);
- signReqId = recDetails.get("Sign_Request_ID");
- docuStatus = recDetails.get("Document_Status");
- if(!"INPROGRESS".equalsIgnoreCase(docuStatus) || signReqId.isNull() || signReqId.isEmpty())
- {
- if(signReqId.isNull() || signReqId.isEmpty())
- {
- return "E-Sign Request Id is not found, Can't send Reminder";
- }
- return "E-Sign Document Status is " + docuStatus + " So, Can't send Reminder";
- }
- dynamic_map = Map();
- //Map all dynamic params to your desired values
- dynamic_map.put("reqId",signReqId);
- dynamic_map.put("remind","remind");
- remindResp = zoho.crm.invokeConnector("esignv2.remindrecipient",dynamic_map);
- info "remindResp is :: " + remindResp;
- status = remindResp.get("status_code");
- if(status >= 200 && status < 300)
- {
- response = remindResp.get("response").toMap();
- remindMsg = response.get("message");
- return remindMsg;
- }
- return "Reminder Failed";
zohosigncallback_Function - The call back function to handle the callbacks, and update the CRM records according to the events. Click
here to download a sample code for this function. Feel free to make changes to handle your specific requirements.
In this step, you need to create a button for the E-Sign in the modules where you want the E-Sign feature. Adding buttons to relevant modules within your solution provides users with intuitive access to Vertical Sign functionalities. Refer to our help document here to know more.
To add a button,
- Click on BUILD > Components in the left pane menu
- Click on Links & Buttons > Create new Button
- In the Create Button page, select the module where you want the E-Sign functionality
- Specify a name for the button. For example, Send for E-Sign
- Add a description for the button.
- Select where you want this button placed. Select View Page to place the button in the record view page.
- Select the action you want the button to perform. In our case, Invoke a Widget.
- Choose the Connected application from the dropdown.
- Specify the resource path for the Sandbox and Production URL
- Specify the dimensions for the button
- Select the profiles that should have access to the button.
- Click Save
For additional functionalities, like Send Sign Reminder, Download completion certificate, or Recall Document, add corresponding buttons, and implement the functionality according to your requirements.
Step 6 : Signals for notifications
To receive notifications about Vertcal Sign events, utilize Signals. You can set up custom signals and activate it using a callback function. For detailed instructions on invoking signals through functions, please see
here.
6.1 Define a signal
- Log in to the Zoho Developer Console and navigate to Vertical Solutions.
- Choose the application you wish to modify and select Edit.
- Access BUILD > Automate > Signals
- Click on Define Signal
- Provide Signal Name and click on Save. Please note that the name space will be generated automatically.
6.2 Trigger the signal via a function
Use the namespace of the signal in the callback function to trigger the signal when an event occurs in Vertcal Sign, according to your requirements. Refer to
this guide for detailed instructions on invoking signals using functions.
After you have successfully completed all the mentioned steps, publish the solution, and upgrade your customers to the latest version.
When a user clicks on the Send for E-Sign button within a module, it invokes the connected app (widget) configured for Vertical Sign integration. This initiates a series of processes orchestrated in the backend. Firstly, the connected app communicates with the established connector, facilitating secure data transmission and interaction with Vertical Sign via the OAuth 2.0 protocol. Subsequently, the app leverages the defined REST APIs to execute specific functions required for the E-Sign process, such as retrieving document templates, sending reminders, and handling recipient responses. Additionally, the app interacts with the custom modules created for Vertical Sign, storing and retrieving relevant data to ensure smooth workflow management. This implementation streamlines the E-Sign process, ensuring a user-friendly experience for both senders and recipients.