================= legalesign-nodejs
Legalesign Node.js helper library - [https://legalesign.com/]
Quick start
var legalesign = API_USERNAME API_PASSWORD;legalesign;
Installation
npm install legalesign --save
Usage
First initialise the Legalesign object using your API credentials. You can only retrieve API credentials by request through your account on Legalesign's website
var legalesign = API_USERNAME API_PASSWORD;
The next step is to describe the details of the document being sent:
var document = name: 'Hello World' group: 'examplegroup' text: '<h1>Example heading</h1><p>Example body</p>' signers: firstname: 'Ex' lastname: 'Ample' email: 'example@legalesign.com' order: 0 do_email: 'true';
Note that even though there is only one signer, the information must be kept in an array.
Finally, you can send the document:
legalesign;
Document
Alternatively, you can create a document using the Document object. This object exposes many methods by which we can construct a document:
Parameters
var params = name = '' group = '/api/v1/group//' do_email = true signature_type = 1 signers = // Either set the text text = '' // OR the PDF to use templatePDF = '' // This is a Resource URI, pdfText = {} // A mapping of labels and values;var doc1 = params; // Feel free to use the following methods:var doc2 = ;
setName
Setter for document name, accepts string
var document = ;document;
setGroup
Setter for document group, accepts string. Note that only the group name is required, NOT the URI for the group
var document = ;document;
setDoEmail
Setter for the do_email property (which determines whether the signers are sent an email), accepts boolean.
var document = ;document;
setSignatureType
Setter for document signature_type, accepts integer
var document = ;document;
setSigners
Setter for document signers, accepts a list
var document = ;document;
addSigner
Adds a signer to the current list of document signers
var document = ;document;
setText
Setter for the document text/content, accepts string
var document = ;document;
addText
Adds text to the document
var document = ;document;
setTemplatePDF
Setter for the document's Template PDF (must be created online before), accepts string. Note that this MUST be the template's online URI
var document = ;document;
setPDFText
Setter for the PDF text labels, accepts object
var document = ;document;
addPDFText
Adds a label and value to the document, accepts two strings
var document = ;document;
License
Licensed under the MIT License