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
// Construct the recipient token authentication assertion and specify | |
// ID, start time, method, and domain | |
$assertion = new RequestRecipientTokenAuthenticationAssertion(); | |
$assertion->AssertionID = guid(); | |
$assertion->AuthenticationInstant = nowXsdDate(); | |
$assertion->AuthenticationMethod = RequestRecipientTokenAuthenticationAssertionAuthenticationMethod::Password; | |
$assertion->SecurityDomain = "Request Recipient Token Test"; | |
// Construct the URLs based on UserName | |
$recip = $env->Recipients[0]; |
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
// Construct the recipient token authentication assertion | |
// Specify ID, start time, method and domain | |
DocuSignWeb.RequestRecipientTokenAuthenticationAssertion assertion | |
= new DocuSignWeb.RequestRecipientTokenAuthenticationAssertion(); | |
assertion.AssertionID = new Guid().ToString(); | |
assertion.AuthenticationInstant = DateTime.Now; | |
assertion.AuthenticationMethod | |
= DocuSignWeb.RequestRecipientTokenAuthenticationAssertionAuthenticationMethod.Password; | |
assertion.SecurityDomain = "Request Recipient Token Test"; |
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
// Create the recipient | |
$rcp1 = new Recipient();// First recipient to put in recipient array | |
$rcp1->UserName = "John Doe"; | |
$rcp1->Email = $Recipient1Email; | |
$rcp1->Type = RecipientTypeCode::Signer; | |
$rcp1->ID = "1"; | |
$rcp1->RoutingOrder = 1; | |
$rcp1->RequireIDLookup = FALSE; | |
// Specify captive info to embed the recipient |
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
// Create the recipient | |
DocuSignWeb.Recipient recipient = new DocuSignWeb.Recipient(); | |
recipient.Email = "Test email"; | |
recipient.UserName = "Testing account"; | |
recipient.Type = DocuSignWeb.RecipientTypeCode.Signer; | |
recipient.ID = "1"; | |
recipient.RoutingOrder = 1; | |
// Need to specify captive info to embed the recipient | |
recipient.CaptiveInfo = new DocuSignWeb.RecipientCaptiveInfo(); |
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
AuthenticationApi authApi = new AuthenticationApi(apiClient); | |
LoginInformation loginInfo = authApi.login(); | |
// note that the user might belong to multiple accounts, here we simply get first | |
String accountId = loginInfo.getLoginAccounts().get(0).getAccountId(); | |
String baseUrl = loginInfo.getLoginAccounts().get(0).getBaseUrl(); | |
// important: below code is required for production as the account sub-domains vary in the | |
// live system. We strip the base URI down to the form https://{env}.docusign.net/restapi | |
// then re-configure the api client with the new base path |
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
// Use the authorization code that was added as a query param to the redirect URI. | |
// from the previous request. You should set up a route that handles the redirect | |
// and parses the code so you can then pass it to token endpoint: | |
String code = "{ENTER_YOUR_AUTHORIZATION_CODE}"; | |
// assign it to the token endpoint | |
apiClient.getTokenEndPoint().setCode(code); | |
// optionally register to get notified when a new token arrives | |
apiClient.registerAccessTokenListener(new AccessTokenListener() { |
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"); |
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 createAndSendEnvelopeWithEmbeddedRecipient (loginAccounts, next) { | |
var fileBytes = null; | |
try { | |
var fs = require('fs'), | |
path = require('path'); | |
// read file from a local directory | |
fileBytes = fs.readFileSync(path.resolve(__filename + '/..' + SignTest1File)); | |
} catch (ex) { |
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
// Install NPM package or download source | |
// https://www.npmjs.com/package/docusign-node | |
var docusign = require('docusign-node'); | |
var async = require('async'); | |
var assert = require('assert'); | |
var fs = require('fs'); | |
var integratorKey = "INTEGRATOR_KEY"; | |
var email = "EMAIL"; |
NewerOlder