Last active
October 18, 2017 12:02
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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