Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
envelopeId = envelopeSummary.getEnvelopeId();
console.log('EnvelopeSummary: ' + JSON.stringify(envelopeSummary));
// ===============================================================================
// Step 3: Create SenderView API
// ===============================================================================
// use the |accountId| we retrieved through the Login API
var loginAccount = new docusign.LoginAccount();
loginAccount = loginAccounts[0];
var accountId = loginAccount.accountId;
// instantiate a new EnvelopesApi object
var envelopesApi = new docusign.EnvelopesApi();
// set the url where you want the sender to go once they are done editing/sending the envelope
var returnUrl = new docusign.ReturnUrlRequest();
returnUrl.setReturnUrl('https://www.docusign.com/devcenter');
// call the createEnvelope() API
envelopesApi.createSenderView(accountId, envelopeId, returnUrl, function (error, senderView, response) {
if (error) {
console.log('Error: ' + error);
return;
}
if (senderView) {
console.log('ViewUrl: ' + JSON.stringify(senderView));
}
});
}
});
}