A simple to use controller for the E-Sign API
npm install e-sign-apiCreated By Isaac Hughes
Github repo click here
- Feautures
- Installing
- Usage
- Calls
- Accounts
- Envelopes
- Oauth
- Payments
- Saml
- Signers
- Tags
- Templates
- Uploads
- Users
- Webhooks
- Example
Using npm:
``bash`
$ npm install e-sign-api
To access the functionality, import the function in the following format
`js`
import { esign } from 'e-sign-api';
jslet data = {
...
}
esign('apikey', 'call', data, true)
`
If the route takes parameters, these should be passed as part of the data object
If the call takes a json body, this too should be passed in the data object`js
let data = {
parameter : {
id : "exampleID",
signerID: "exampleSignerID"
},
body : {
id: "objectID"
}
}
`
All the calls follow a logical naming convention
If an undefined call is passed, you will be alerted in the console
All the calls are listed below
Please view the swagger to see what data should be passed with each call and the correct parameter id's
click here
Calls
$3
- createAccount
- retrieveAccount
- updateAccount
- deleteAccount
- getAccountWithAllUsers
- getAccountStats
- getRecentEvents
- getExtensionsList
- enableExtension
- disableExtension
$3
- createEnvelope
- retrieveEnvelope
- archiveEnvelope
- restoreEnvelope
- redirectToWebApp
- getSignedEnvelopes
- getCompletedEnvelopes
- getPendingEnvelopes
- getDeclinedEnvelopes
- getInboxEnvelopes
- getArchivedEnvelopes
- getEnvelope
- permanentlyDeleteEnvelope
- getSignerEnvelope
- getAuditTrail
- getAttachments
$3
- createOauthApp
- getOauthApps
- getOauthApp
- deleteOauthApp
- createAuthCode
- retrieveAccessToken
- revokeAccessToken
- getTokenInfo
$3
- addPaymentDetails
- deletePaymentDetails
- setupDirectDebit
- confirmDirectDebit
- cancelDirectDebit
- getPlans
- changePlan
- paymentCharge
- getInvoices
- getInvoice
$3
- ssoLogin
- ssoCallback
$3
- createReminder
- getReminder
- destroyReminder
- signDocument
- getSignerEnvelopeFromSigners
- updateSigner
$3
- createTag
- getTags
- updateTag
- deleteTag
- getResourcesByTagAndType
$3
- createTemplate
- getTemplates
- generateEnvelopeRequest
- updateTemplate
- retrieveTemplate
- deleteTemplate
$3
- uploadFiles
- archiveFiles
- getFilesByType
- getFileByID
- uploadCSVFile
$3
- userLogin
- userLogout
- createContact
- getContact
- updateContact
- deleteContact
- requestPasswordReset
- resetPassword
- redirectToPasswordReset
- createSignature
- updateSignature
- getSignature
- deleteSignature
- inviteUser
- retrieveUsers
- getUserByID
- updateUser
- removeUser
- resendToken
- confirmUser
- confirmInvite
$3
- createWebhook
- getWebhooks
- deleteWebhook
Example
`js
import { esign } from 'e-sign-api';let data = {
parameters: {
id : 'b791c2f7-8aab-4450-bfe3-d1af87ce465c'
}
}
let response = await esign('demo12345678', 'retrieveAccount', data, true)
`resonse data (collapsed objects)
`js
{
json : {
account: {
id: 'b791c2f7-8aab-4450-bfe3-d1af87ce456c',
company_name: 'Demo Account',
shared: false,
parent_account_id: '77e41daa-6513-4f3e-b8d8-e7d5ce936492',
users: [ [Object] ],
subscription: {
state: 'active',
days_until_trial_expires: null,
currency: [Object],
credits: [Object],
payment: [Object]
},
additional_info: { documents_sent_this_month: 0, enabled_extensions: [] },
limits: { document_sends_per_month: 3000 }
},
links: [
{
method: 'get',
rel: 'accounts.getAccountAllUsers',
uri: '/accounts/includes/users'
},
{ method: 'patch', rel: 'users.createUser', uri: '/users' }
]
},
status: 200,
statusText: "OK",
headers: {
'content-type': 'application/json',
'transfer-encoding': 'chunked',
connection: 'close',
status: '200 OK',
'cache-control': 'max-age=0, private, must-revalidate, no-cache',
vary: 'Origin',
'strict-transport-security': 'max-age=63072000; includeSubDomains, max-age=31536000; includeSubdomains; preload',
'referrer-policy': 'strict-origin-when-cross-origin, strict-origin',
'x-permitted-cross-domain-policies': 'none',
'x-xss-protection': '1; mode=block, 1; mode=block',
'x-request-id': 'cb9567ff-bb96-4def-ba33-ada48',
'x-download-options': 'noopen',
etag: 'W/"b766bd2e02bac59bcd50eb8406"',
'x-frame-options': 'SAMEORIGIN',
'x-runtime': '0.039731',
'x-content-type-options': 'nosniff, nosniff',
date: 'Thu, 25 Nov 2021 15:22:22 GMT',
'x-powered-by': 'Phusion Passenger 6.0.4',
server: 'nginx + Phusion Passenger 6.0.4'
}
}
``