How to upload a Zoho Sign Completed Document in Zoho workdrive Folder

There are several methods to upload Zoho Sign completed documents either as attachments in the Zoho CRM module or to the respective WorkDrive folder.

1. Using Zoho Flow:

Please refer to the screenshot below for your reference:
Using Zoho Flow how to Save the Zoho Sign Complete Docs in Zoho Workdrive

Please Find the below Deluge Script which I wrote in "Save_Zoho_Sign_Complete" custom function in zoho zoho flow:-


void Save_Zoho_Sign_Complete_doc_workdrive(String requestID, String workdriveurl)

{

response = invokeurl

[

url :"https://sign.zoho.eu/api/v1/requests/" + requestID + "/pdf"

type :GET

connection:"zohosign"

response-format:FILE

];

info response;

if(!isNull(workdriveurl))

{

FolderID = ifnull(workdriveurl.getSuffix("folder/"),"");

header = Map();

header.put("Accept","application/vnd.api+json");

list_of_text = List();

list_of_text.add({"paramName":"filename","content":"MA Declaration Signed Document.pdf","stringPart":"true"});

list_of_text.add({"paramName":"parent_id","content":FolderID,"stringPart":"true"});

list_of_text.add({"paramName":"override-name-exist","content":"true","stringPart":"true"});

list_of_text.add({"paramName":"content","content":response,"stringPart":"false"});

Upload = invokeurl

[

url :"https://www.zohoapis.eu/workdrive/api/v1/upload"

type :POST

headers:header

files:list_of_text

connection:"workdrive"

];

info Upload;

}

}

Output:-

Zoho Workdrive Folder in which ZOHO Sign Docs Save in PDF format

2. Using Zoho Sign Webhook and Zoho CRM Standalone Function:

Steps:
a. Create a standalone function in Zoho CRM and generate its REST API URL.

Deluge Script:-

string standalone.Webhook_signed_function1(String crmAPIRequest)

{

crmAPIRequestMap = crmAPIRequest.toMap();

request_body = crmAPIRequestMap.get("body");

request_id = request_body.get("requests").get("request_id");

info request_id;

respDoc = zoho.sign.downloadDocument(request_id);

info respDoc;

fileName = respDoc.getFileName();

info fileName;

response = zoho.crm.searchRecords("Sales","(Zoho_Sign_Signing_Form_ID:equals:" + request_id + ")");

info response;

if(response.size() > 0)

{

drive_folder = response.get(0).get("Sales_Workdrive").getSuffix("https://workdrive.zoho.eu/folder/");

uploadtoWD = zoho.workdrive.uploadFile(respDoc,drive_folder,fileName,false,"workdrive_connection");

info uploadtoWD;

sid = response.get(0).get("id");

m = Map();

m.put("Signing_Form_Completed",true);

update = zoho.crm.updateRecord("Sales",sid,m);

}

return "";

}


b. In Zoho Sign, navigate to Settings > Developer Settings > Create Webhook.

– Paste the copied REST API URL as the Callback URL
– Enter a Webhook Name
– Set the Callback Criteria to trigger when the document name contains "Signing"
– Under Callback Events, select the checkbox for "Completed by all"
– Click Save to finalize the webhook setup







Post a Comment