Skip to content

Instantly share code, notes, and snippets.

@Ergin008
Last active October 18, 2017 12:02
Show Gist options
  • Save Ergin008/43372184ceffe9b36e36 to your computer and use it in GitHub Desktop.
Save Ergin008/43372184ceffe9b36e36 to your computer and use it in GitHub Desktop.
code snippets that shows how to request a recipient view (signing URL) using the DocuSign Node Client
function requestRecipientView (envelopeId, loginAccounts, next) {
// set where the recipient should be re-directed once they are done signing
const returnUrl = "http://www.docusign.com/developer-center";
var recipientView = new docusign.RecipientViewRequest();
recipientView.setReturnUrl(returnUrl);
recipientView.setUserName("[RECIPIENT_NAME]");
recipientView.setEmail("[RECIPIENT_EMAIL]");
recipientView.setAuthenticationMethod("email");
recipientView.setClientUserId("1234"); // must match the clientUserId used in step #2!
var envelopesApi = new docusign.EnvelopesApi();
envelopesApi.createRecipientView(loginAccounts[0].accountId, envelopeId, recipientView, function(error, viewUrl, response) {
if (error) {
return next(error);
}
if (viewUrl) {
console.log("RecipientViewUrl = " + JSON.stringify(viewUrl));
next();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment