Promise based DocuSign API for NodeJS.
npm install docusign-api
var DocuSign = require('docusign-api'),
var config = {
email: '#EMAIL',
password: '#PASSWORD',
key: '#INTEGRATOR KEY'
};
// Then we instantiate a client with DocuSign auth tokens
var docuSign = new DocuSign(config);
You must have a valid DocuSign auth token (password and integrator key) for the following:
var docuSign = new DocuSign(config);
docuSign
.login()
.then(function(response){
console.log('API baseUrl', response.baseUrl);
console.log('DocuSign accountId', response.accountId);
});
var docuSign = new DocuSign(config);
var envelopeRequest = {
emailSubject: 'API Call that uses a Template',
templateId: 'xxxxx-xxx-xxxx-xxxx-xxxxxxxxxx',
templateRoles: [{
roleName: 'Role'
name: 'Sally Doe',
email: 'sally.doe@email.com'
}],
status: 'sent'
};
docuSign
.requestSignature(envelopeRequest)
.then(function(envelopeId){
console.log('Envelope ID', envelopeId);
});
var docuSign = new DocuSign(config);
var envelopeId = 'xxxx-xxx-xxxx';
var recipientRequest = {
returnUrl: 'http://www.docusign.com/devcenter',
authenticationMethod: 'email',
userName: 'Sally Doe',
email: 'sally.doe@email.com'
};
docuSign
.getRecipientView(envelopeId, recipientRequest)
.then(function(response){
console.log('Embedded signing workflow Url', response.url);
});
npm test
Integration tests will test the API end to end against a real DocuSign API endpoint. You will first
need to rename config.dev.json.stub
to config.dev.json
and update with your DocuSign auth settings.
To run integration tests:
grunt integration
Copyright (c) 2015 Hady Osman
Licensed under the MIT license.