document_id = 'po5uobda049e029d44b13a9956f6d2cedc67b';
fields = Map();
fields.put('InvoiceNo','12345');
fields.put('InvoiceDate','27 May 2022');
fields.put('InvoiceAmount','$100');
data_map = Map();
data_map.put('data', fields)
merge_details = Map();
merge_details.put('merge_data', data_map);
filename = 'Invoice data';
signerList = List();
signerObj1 = Map();
signerObj1.put('action_type','approve'); //approve|sign|view
signerObj1.put('language','en');
signerObj2 = Map();
signerObj2.put('action_type','sign'); //approve|sign|view
signerObj2.put('language','fr');
signerList.add(signerObj1);
signerList.add(signerObj2);
commonAttachmentFile1 = invokeurl
[
type :GET
];
option_settings = Map();
option_settings.put('sign_in_order','true');
option_settings.put('message', 'Please find the document to be signed こちら');
option_settings.put('set_expire', '30');
option_settings.put('reminder_period', '15');
option_settings.put('common_attachments', commonAttachmentFile1);
option_settings.put('test_mode', 'true');
response = zoho.writer.mergeAndSign(document_id, merge_details, filename, signerList, option_settings, 'writer_oauth_connection');
info response;