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.envelopeId;
console.log('EnvelopeSummary: ' + JSON.stringify(envelopeSummary));
// ===============================================================================
// Step 3: Create RecipientView 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 recipient to go once they are done signing
var returnUrl = new docusign.RecipientViewRequest();
returnUrl.setReturnUrl('https://www.docusign.com/devcenter');
returnUrl.setAuthenticationMethod('email');
// recipient information must match embedded recipient info we provided in step #2
returnUrl.setEmail(signerEmail);
returnUrl.setUserName(signerName);
returnUrl.setRecipientId('1');
returnUrl.setClientUserId('1001');
// call the CreateRecipientView API
envelopesApi.createRecipientView(accountId, envelopeId, returnUrl, function (error, recipientView, response) {
if (error) {
console.log('Error: ' + error);
return;
}