Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log('LoginInformation: ' + JSON.stringify(loginAccounts));
// ===============================================================================
// Step 2: Create ConsoleView 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 user to go once they logout of the Console
var returnUrl = new docusign.ConsoleViewRequest();
returnUrl.setReturnUrl('https://www.docusign.com/devcenter');
// call the createConsoleView() API
envelopesApi.createConsoleView(accountId, returnUrl, function (error, consoleView, response) {
if (error) {
console.log('Error: ' + error);
return;
}
if (consoleView) {
console.log('ConsoleView: ' + JSON.stringify(consoleView));
}
});
}
});
}; // end EmbeddedConsole()