-
Notifications
You must be signed in to change notification settings - Fork 5
API Documentation
new HelloWorks(config)
Create a new HelloWorks SDK client instance in order to make HelloWorks API requests from your Node.js app. In most cases, only one instance should exist per application.
-
configObject-
apiKeyIdstringThe HelloWorks API key ID.
-
apiKeySecretstringThe HelloWorks API key secret.
-
-
Instantiate a new HelloWorks SDK client.
const client = new HelloWorks({ apiKeyId: 'AbCd1234AbCd1234', apiKeySecret: 'WxYz7890WxYz7890WxYz7890WxYz7890WxYz7890' });
client.token.getToken(options)
Gets a new JWT token.
Note: If you are using this SDK, the JWT token needed to make authorized API calls is generated behind the scenes. Only use this method if you specifically need to generate a new one. This will not update the JWT token used internally.
-
optionsObject-
apiKeyIdstringYour HelloWorks API key ID.
-
apiKeySecretstringYour HelloWorks API key secret.
-
{
token: String,
expires_at: Number
}-
Gets a new JWT token. More information about this endpoint can be found in the HelloWorks API Documentation.
client.token.getToken({ apiKeyId: 'AbCd1234AbCd1234', apiKeySecret: 'WxYz7890WxYz7890WxYz7890WxYz7890WxYz7890' }).then(({ token, expires_at }) => { // ... });
client.workflowInstances.createInstance(options)
Creates a new workflow instance from the workflow with the given ID and the given set of options. More information about this endpoint can be found in the HelloWorks API Documentation.
-
optionsObject-
workflowIdstringThe ID of the Workflow that you want to create an instance of.
-
participantsArray.<Participant>The participants parameters and its options for each of the roles. The initial role that's available is named
signer. -
mergeFieldsObject (optional)The merge fields for the Workflow Instance. This should be a nested object with Step IDs, field names, and values. See below for details.
-
callbackUrlstring (optional)HTTPS URL for receiving a callback
POSTupon completion of the workflow instance. -
redirectUrlstring (optional)URL to redirect the user to upon completion of a signer step.
-
documentDeliveryboolean (optional)Flag that this will mute notifications and allow teams to fetch an authenticated url.
Defaults to
false.
-
{
id: String,
mode: String,
steps: Step[]
}See Type: Step.
-
Create a new workflow instance.
client.workflowInstances.createInstance({ workflowId: 'AbCd1234AbCd1234', participants: { signer: { type: 'email', value: '[email protected]', fullName: 'Lauren Ipsum' } } }).then((instance) => { // ... });
-
Create a new workflow instance with additional options.
client.workflowInstances.createInstance({ workflowId: 'AbCd1234AbCd1234', participants: { signer: { type: 'email', value: '[email protected]', fullName: 'Lauren Ipsum', }, }, mergeFields: { signerName_28XkWu: 'Lauren Ipsum', }, callbackUrl: 'https://example.com/callback', redirectUrl: 'https://example.com/success', documentDelivery: true }).then((instance) => { // ... });
client.workflowInstances.getInstance(options)
Gets the information for a given workflow instance. More information about this endpoint can be found in the HelloWorks API Documentation.
-
optionsObject-
instanceIdstringThe workflow instance ID.
-
-
Completed workflow
{ id: String, workflow_id: String, status: String, type: 'workflow_stopped', mode: String, audit_trail_hash: String, document_hashes: { [Document ID]: String, // ... }, data: { [Document ID]: { [Field]: String, // ... }, // ... } }
-
Pending workflow
{ id: String, workflow_id: String, status: String }
-
Cancelled workflow
{ id: String, workflow_id: String, status: String, mode: String, data: { [Document ID]: { [Field]: String, // ... }, // ... } }
-
Get the information on a workflow instance.
client.workflowInstances.getInstance({ instanceId: 'AbCd1234AbCd1234' }).then((instance) => { // ... });
client.workflowInstances.getInstanceSteps(options)
Gets the instances steps for a given workflow instance. More information about this endpoint can be found in the HelloWorks API Documentation.
-
optionsObject-
instanceIdstringThe workflow instance ID.
-
Step[]See Type: Step.
-
Get the instance steps for a workflow instance.
client.workflowInstances.getInstanceSteps({ instanceId: 'AbCd1234AbCd1234' }).then((stepsArr) => { // ... });
client.workflowInstances.getInstanceAuditTrail(options)
Gets the audit trail for a given workflow instance as a buffer for easy downloading. More information about this endpoint can be found in the HelloWorks API Documentation.
-
optionsObject-
instanceIdstringThe workflow instance ID.
-
Buffer
-
Download the workflow instance audit trail to
file.pdf.const fs = require('fs'); client.workflowInstances.getInstanceAuditTrail({ instanceId: 'AbCd1234AbCd1234' }).then((buffer) => { fs.writeFile('file.pdf', buffer, (err) => { // ... }); });
client.workflowInstances.getInstanceDocument(options)
Gets a document for a given workflow instance as a buffer for easy downloading. More information about this endpoint can be found in the HelloWorks API Documentation.
-
optionsObject-
instanceIdstringThe workflow instance ID.
-
documentIdstringThe workflow instance document ID.
-
Buffer
-
Download the workflow instance document to
file.pdf.const fs = require('fs'); client.workflowInstances.getInstanceDocument({ instanceId: 'AbCd1234AbCd1234', documentId: 'WxYz' }).then((buffer) => { fs.writeFile('file.pdf', buffer, (err) => { // ... }); });
client.workflowInstances.cancelInstance(options)
Cancels a given workflow instance. More information about this endpoint can be found in the HelloWorks API Documentation.
-
optionsObject-
instanceIdstringThe workflow instance ID.
-
-
Cancel a workflow instance.
client.workflowInstances.cancelInstance({ instanceId: 'AbCd1234AbCd1234' }).then(() => { // ... });
-
typestringThe type of notification to send.
emailorphone. -
valuestringThe value corresponding to the
type. If thetypeisemail, thevalueshould be the email of the recipient, or the phone number if thetypeisphone. -
fullNamestringThe full name of the associated
typeandvalue.
-
stepstringThe unique step ID.
-
rolestringThe name of the role that will be completing the task.
-
participantstringThe signer's full name.
-
urlstringThe unauthenticated url that can be used to start entering information.
Having trouble? Let us know!
Welcome!
Below you will find links to the API documentation, frequently asked questions, and other useful tidbits.
Find something incorrect or missing? Shoot us an email or create an issue.
Having trouble? Let us know!