This package is a wrapper for Signaturit Api. If you didn't read the documentation yet, maybe it's time to take a look here.
Just import the Signaturit Client this way
var SignaturitClient = require('signaturit-sdk');
Then you can authenticate yourself using your AuthToken
client = new SignaturitClient('TOKEN')
Remember that you can test the api on our sandbox server, so, if you want to do all the calls to sandbox, set the parameter false in the constructor. If you want use production set the parameter true.
client = new SignaturitClient('TOKEN', false)
Retrieve all data from your signature requests using different filters.
client.getSignatures().then(function (result) {
// success code
}, function (error) {
// error code
});
client.getSignatures(50).then(function (result) {
// success code
}, function (error) {
// error code
});
client.getSignatures(50, 50).then(function (result) {
// success code
}, function (error) {
// error code
});
client.getSignatures(null, null, { status: 'completed' }).then(function (result) {
// success code
}, function (error) {
// error code
});
client.getSignatures(null, null, { status: 'completed', since: '2014-7-20' }).then(function (result) {
// success code
}, function (error) {
// error code
});
client.getSignatures(null, null, { crm_id: 2445 }).then(function (result) {
// success code
}, function (error) {
// error code
})
Count your signature requests.
client.countSignatures().then(function (result) {
// success code
}, function (error) {
// error code
})
Get a single signature request.
client.getSignature('SIGNATURE_ID').then(function (result) {
// success code
}, function (error) {
// error code
})
Create a new signature request. You can check all signature params.
recipients = [
{ name: 'Bob', email: 'api@signaturit.com', phone: 346661058397 }
];
files = ['./Signaturit.pdf'];
sign_params = {
subject: 'Receipt number 250',
body: 'Please, can you sign this document?'
}
client.createSignature(files, recipients, sign_params).then(function (result) {
// success code
}, function (error) {
// error code
})
You can send templates with the fields filled
sign_params = {
subject: 'Receipt number 250',
body: 'Please, can you sign this document?',
templates: ['TEMPLATE_NAME'],
data: { WIDGET_ID: 'DEFAULT_VALUE' }
}
client.createSignature([], recipients, sign_params).then(function (result) {
// success code
}, function (error) {
// error code
})
You can add custom info in your requests
files = ['./Signaturit.pdf'];
sign_params = {
subject: 'Receipt number 250',
body: 'Please, can you sign this document?',
data: { crm_id: 2445 }
}
client.createSignature(files, recipients, sign_params).then(function (result) {
// success code
}, function (error) {
// error code
})
Cancel a signature request.
client.cancelSignature('SIGNATURE_ID').then(function (result) {
// success code
}, function (error) {
// error code
})
Send a reminder to signature request.
client.sendSignatureReminder('SIGNATURE_ID').then(function (result) {
// success code
}, function (error) {
// error code
})
Get the audit trail of a signature request document
client.downloadAuditTrail('SIGNATURE_ID', 'DOCUMENT_ID').then(function (result) {
// success code
}, function (error) {
// error code
})
Get the signed document of a signature request document
client.downloadSignedDocument('SIGNATURE_ID', 'DOCUMENT_ID').then(function (result) {
// success code
}, function (error) {
// error code
})
Get all account brandings.
client.getBrandings().then(function (result) {
// success code
}, function (error) {
// error code
})
Get a single branding.
client.getBranding('BRANDING_ID').then(function (result) {
// success code
}, function (error) {
// error code
})
Create a new branding. You can check all branding params.`
brandingParams = {
layout_color: '#FFBF00',
text_color: '#2A1B0A',
application_texts: {
sign_button: 'Sign!'
}
}
client.createBranding(brandingParams).then(function (result) {
// success code
}, function (error) {
// error code
})
Update a single branding.
brandingParams = {
application_texts: {
send_button: 'Send!'
}
}
client.updateBranding('BRANDING_ID', brandingParams).then(function (result) {
// success code
}, function (error) {
// error code
})
Retrieve all data from your templates.
client.getTemplates().then(function (result) {
// success code
}, function (error) {
// error code
})
##Emails
Get all certified emails
####Get all certified emails
client.getEmails().then(function (result) {
// success code
}, function (error) {
// error code
});
####Get last 50 emails
client.getEmails(50).then(function (result) {
// success code
}, function (error) {
// error code
});
####Navigate through all emails in blocks of 50 results
client.getEmails(50, 50).then(function (result) {
// success code
}, function (error) {
// error code
});
Count all certified emails
client.countEmails().then(function (result) {
// success code
}, function (error) {
// error code
});
Get a single email
client.getEmail('EMAIL_ID').then(function (result) {
// success code
}, function (error) {
// error code
});
Create a new certified email.
recipients = [
{ name: 'Bob', email: 'api@signaturit.com', phone: 346661058397 }
];
files = ['./Signaturit.pdf'];
client.createEmail(files, recipients, 'Node subject', 'Node body').then(function (result) {
// success code
}, function (error) {
// error code
});
Get the audit trail document of an email request
client.downloadEmailAuditTrail('EMAIL_ID', 'CERTIFICATE_ID').then(function (result) {
// success code
}, function (error) {
// error code
});
Get all certified sms
####Get all certified sms
client.getSms().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
####Get last 50 sms
client.getSms(50).then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
####Navigate through all sms in blocks of 50 results
client.getSms(50, 50).then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Count all certified sms
client.countSms().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get a single sms
client.getSingleSms('SMS_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Create a new certified sms.
recipients = [
{'name': 'Bob', 'phone': 34123456}
];
client.createSms([], recipients, "Node body").then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get the audit trail document of an sms request
client.downloadSmsAuditTrail('SMS_ID','CERTIFICATE_ID').then(function (error, result) {
if (result) {
// success code
}
if (error) {
// Error code
}
})
Get all account users
client.getUsers().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get all account seats
client.getSeats().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get a single user
client.getUser('USER_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Invite user to join the team
client.inviteUser('bob.soap@signaturit.com', 'admin').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Change role for user
client.changeUserRole('USER_ID', 'member').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Remove user from the team
client.removeUser('USER_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Remove seat from the team
client.removeSeat().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get all account groups
client.getGroups().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get a single group
client.getGroup('GROUP_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Create a new group
client.createGroup('test_node').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Update group name
client.updateGroup('GROUP_ID', 'new_name').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Delete a group
client.deleteGroup('GROUP_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Add a manager to a group
client.addManagerToGroup('GROUP_ID', 'USER_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Add a member to a group
client.addMemberToGroup('GROUP_ID', 'USER_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
### Delete manager from group
Remove a manager from group
client.removeManagerFromGroup('GROUP_ID', 'USER_ID').then(function(error, result) { if (result) { // Success code }
if (error) {
// Error code
}
});
### Delete member from group
Remove a member from group
client.removeMemberFromGroup('GROUP_ID', 'USER_ID').then(function(error, result) { if (result) { // Success code }
if (error) {
// Error code
}
});
Get all contacts
client.getContacts().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get a single contact
client.getContact('CONTACT_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Create a new contact
client.createContact('email@signaturit.com', 'name').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Update contact
client.updateContact('CONTACT_ID', 'new_email@signaturit.com', 'name1').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Delete a contact
client.deleteContact('CONTACT_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get all subscriptions
client.getSubscriptions().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Count all subscriptions
client.countSubscriptions().then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});
Get a single subscription
client.getSubscription('SUBSCRIPTION_ID').then(function(error, result) {
if (result) {
// Success code
}
if (error) {
// Error code
}
});