Hello,
I am working on a creator app that triggers a workflow that gets a file and creates a document in Zoho Sign.
Using that result, It adds recipient and fields and submits the request to send the document for signing.
The first part works fine, I can create the document and see it in Zoho Sign but for some reason, the submitRequest method does nothing meaning that the recipients etc aren't added to the document and if I try to log the response nothing pops up.
Can any assistance be provided?
- // Define variables
fullUrl = [insert url here]
approverEmail = [insert email address here];
pdfFile = invokeurl
[
url :fullUrl
type :GET
connection:"zohooauth"
];
pdfFile.setParamName("file");
res = zoho.sign.createDocument(pdfFile);
if(res.getJSON("status") == 'success')
{
documents = res.getJSON("requests").getJSON("document_ids");
documentId = documents.get(0).getJSON("document_id");
totalPages = documents.get(0).getJSON("total_pages");
requestId = res.get('requests').get("request_id");
requestName = res.get('requests').get("request_name");
input.Document_ID = documentId;
pageNumber = totalPages - 1;
actionMap = Map();
actionMap.put("request_name",requestName);
textFields = List();
// 1st Signature Field
textField1 = Map();
textField1.put("field_name","Signature");
textField1.put("is_mandatory","true");
textField1.put("field_type_name","Signature");
textField1.put("field_category","image");
textField1.put("field_label","Signature");
textField1.put("document_id",documentId);
textField1.put("x_coord",240);
textField1.put("y_coord",815);
textField1.put("page_no",pageNumber);
textFields.add(textField1);
fieldMap = Map();
fieldMap.put("fields",{"text_fields":textFields});
fieldMap.put("recipient_name","Approver 1");
fieldMap.put("recipient_email",approverEmail);
fieldMap.put("action_type","SIGN");
fieldList1 = List();
fieldList1.add(fieldMap);
// Create and add recipients to a list
actionMap.put("actions",fieldList1);
// Create a request map and add recipient list
submitMap = Map();
submitMap.put("requests",actionMap);
// Perform submit request task to insert fields and send the document to the specified recipients
response = zoho.sign.submitRequest(requestId,{"data":submitMap}, "zohooauth");
info response;
}