Recently We received a business use case where a client is using Zoho CRM to manage their Sales process and was in need to send the contract for Digital signature to his customers. Clients wanted to use the PandaDoc Digital signature tool for signature. We created a trigger point in Zoho CRM to send the contract for digital signature to the customer and once the customer signed it saved the contract PDF copy against the customer record in Zoho CRM
Here are the steps, we have taken to achieve this
Step 1. Generate API keys.
To begin with the integration process, Login to your account and you will be redirected to dashboard. In the dashboard, click settings gear icon at the down left side.
In the next page under Workspace Settings click Integrations. Scroll down and you will find API section.
Click API and generate sandbox api for testing.
Step 2: Create a template.
Go to the template section and click Create to create a new template. You can create a template from scratch or import a document also. In this tutorial I have imported a word file and added four text fields which look like this.
Text fields can be added easily to the template by drag and drop. After you added a text field, click on the field and click on properties. In the right side a Text Field properties section will appear where you need to enter Field ID and Merge Field etc.
Set the fields name as Text1, Text2, Text3 and Text4
Now get the template id from url section. The template id is the last part of the url.
Open a Zoho CRM module which data you want to pass on to pandadoc. In this case we will use Contacts module. In the Contacts module create a button that will pass data to document in pandadoc. For this we write a deluge code.
3. Create a document in Pandadoc via API call
We will make an API call to pandadoc from Zoho CRM. We need the API keys to authenticate the call. Pass on the api keys as headers. We also need to pass the document name, template id, recipients(optional) and Text field values which are need to updated in Pandadoc as parameters.
mapvar = Map(); mapvar.put("name",name + "Demo Document"); mapvar.put("template_uuid","uvEXRoPvKcxgdkkdjGfFptgzne3ghhshss"); email = Map(); email.put("email",Email); email.put("first_name",name); email.put("last_name","last"); email.put("role","Client"); rec = List(); rec.add(email); mapvar.put("recipients",rec); val1 = Map(); val1.put("value", "Test1"); val2 = Map(); val2.put("value", "Test2"); val3 = Map(); val3.put("value", "Test3"); val4 = Map(); val4.put("value", "Test4"); field.put("Text1",val1); field.put("Text2",val2); field.put("Text3",val3); field.put("Text4",val4); header_data = Map(); header_data.put("Content-Type","application/json"); header_data.put("Authorization","API-Key [Paste your own api key]"); response = invokeurl [ url :"https://api.pandadoc.com/public/v1/documents" type :POST parameters:mapvar.toString() headers:header_data ];
For detailed documentation, visit the link below.
4. Send the pandadoc document to sign
After the document has been created, it need to be signed for which the the document need to be sent to the client. So, we need to make an API call to send the document to the client.
msg = Map(); msg.put("message","Please sign the loan document."); msg.put("subject","Chinch Loan Agreement"); info msg; response = invokeurl [ url :"https://api.pandadoc.com/public/v1/documents/" + id + "/send" type :POST parameters:msg headers:header_data ];
5. Download the Pandadoc document into Zoho CRM
After the signing proces we may need to download the document and save it to Zoho CRM module. Below is the API to download the pandadoc document.
response = invokeurl [ url :"https://api.pandadoc.com/public/v1/documents/" + id + "/download" type :GET headers:header_data ];
Consult us, If you are facing any issues while integrating Zoho CRM with Pandadoc or any third party integration or visit the link below.
Zoho CRM Consulting and Customization