How to use the docusign-esign.LoginAccount function in docusign-esign

To help you get started, we’ve selected a few docusign-esign examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github docusign / docusign-node-client / test / Recipes / CoreRecipes.js View on Github external
envelopesApi.createEnvelope(accountId, envDef, null, function (error, envelopeSummary, response) {
        if (error) {
          console.log('Error: ' + error);
          return;
        }

        if (envelopeSummary) {
          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');