Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var EmbeddedConsole = function () {
// initialize the api client
var apiClient = new docusign.ApiClient();
apiClient.setBasePath(BaseUrl);
// create JSON formatted auth header
var creds = '{"Username":"' + UserName + '","Password":"' + Password + '","IntegratorKey":"' + IntegratorKey + '"}';
apiClient.addDefaultHeader('X-DocuSign-Authentication', creds);
// assign api client to the Configuration object
docusign.Configuration.default.setDefaultApiClient(apiClient);
// ===============================================================================
// Step 1: Login() API
// ===============================================================================
// login call available off the AuthenticationApi
var authApi = new docusign.AuthenticationApi();
// login has some optional parameters we can set
var loginOps = new authApi.LoginOptions();
loginOps.setApiPassword('true');
loginOps.setIncludeAccountIdGuid('true');
authApi.login(loginOps, function (error, loginInfo, response) {
if (error) {
console.log('Error: ' + error);
return;
}
// point to a local document for testing
var SignTest1File = '[PATH/TO/DOCUMENT/TEST.PDF]';
// we will generate this from the second API call we make
var envelopeId = '';
// initialize the api client
var apiClient = new docusign.ApiClient();
apiClient.setBasePath(BaseUrl);
// create JSON formatted auth header
var creds = '{"Username":"' + UserName + '","Password":"' + Password + '","IntegratorKey":"' + IntegratorKey + '"}';
apiClient.addDefaultHeader('X-DocuSign-Authentication', creds);
// assign api client to the Configuration object
docusign.Configuration.default.setDefaultApiClient(apiClient);
// ===============================================================================
// Step 1: Login() API
// ===============================================================================
// login call available off the AuthenticationApi
var authApi = new docusign.AuthenticationApi();
// login has some optional parameters we can set
var loginOps = new authApi.LoginOptions();
loginOps.setApiPassword('true');
loginOps.setIncludeAccountIdGuid('true');
authApi.login(loginOps, function (error, loginInfo, response) {
if (error) {
console.log('Error: ' + error);
return;
}