blog-image

How to integrate eSignatures with Node.Js Applications?

Integrating eSignatures directly into your Node.js application enables you to manage the complete signing process within your platform. By enabling electronic signatures with Node.js applications, you not only offer users a streamlined signing experience but also eliminate reliance on third-party tools. That means faster workflows, fewer errors, and greater control over your document lifecycle—from sending requests and tracking statuses to collecting completed signatures. This useful guide will walk you through how to easily integrate e-Signatures into your Node.js application using KAiZEN’s API, enabling seamless, secure, and legally compliant document signing—without the typical development headaches.

Simple Steps to add eSignatures into Node.JS Applications:

Step 1:

Begin by listing the individuals who need to sign the document and determining the sequence of their signatures. KAiZEN allows for sequential signing, ensuring signers follow the order you define.

For Example:

Signer Information
Signer Name Order Signer Email
Signer 1 1 signer1@gmail.com
Signer 2 2 signer2@gmail.com
  1. Step 2:

    You’ll need to initiate a secure HTTP POST request to the KAiZEN “Initiate Sign API” with the following parameters:

    HTTP Call Details
    Parameters Name Value
    Content-Type application/json
    Method POST
    Endpoint https://fa-kaizen-prod.azurewebsites.net/api/Sign/RequestStr?code=RTa1A0GW5Yl92OF54-73lRqglLFCt_0pVcg86hWf1EjtAzFuNROcdA==
    Body JSON Body with parameters
    Key Parameters for the Request Body
    Parameters Name Description Required?
    docContent Base64 Content for the PDF File Yes
    docName Name of the File Yes
    appToken Unique Code to initiate the request Yes
    requesterEmail Email address of the person initiating the request Yes
    requesterName Name of the person initiating the request Yes
    description Describes the document NO
    signers An array of the signers who needs to sign the document in the pre-defined order. Yes
    CallBackURL CallbackURL defines the url on which the KAiZEN should send a response once all the signers signs the document. It can be webservice url of Salesforce or any external page.

    Eg: https://duumy.my.salesforce- sites.com/services/apexrest/KaizenCallbackURL/
    No
    newRequestEmailSubject Describes the email subject No
    requesterMessage Describes the prompt eSignature field No
    docDescription Describes the document No
  2. Step 3:

    Implement the Node.js Integration Code

    							
    const axios = require('axios');
    let data = JSON.stringify({
      "docContent": "<< base 64 content of the document",
      "docName": "KaizenTest.pdf",
      "appToken": "xxxxxxxx-xxxxx (Add App Token shared by KAiZEN Team)",
      "requesterEmail": "xyx@gmail.com",
      "requesterName": "XYZ",
      "requesterPhone": "xxxxx-xxx-xxxx",
      "description": "",
      "newRequestEmailSubject": "You have a document to sign",
      "requesterMessage": "Kindly eSign your document",
      "signers": [
        {
          "signerEmail": "signer1@gmail.com",
          "signerName": "Signer1",
          "signerPhone": "xx-xxx-xxxx-xxx",
          "order": "1",
          "signerRole": "signer"
        },
        {
          "signerEmail": "signer2@gmail.com",
          "signerName": "Signer2",
          "signerPhone": "xxx-xxx-xxxx-xxxx",
          "order": "2",
          "signerRole": "reviewer"
        }
      ],
      "docDescription": "Base 64 string based test doc",
      "callbackurl": ""
    });
    
    
    let config = {
      method: 'post',
      maxBodyLength: Infinity,
      url: 'https://fa-kaizen-staging.azurewebsites.net/api/Sign/RequestStr?code=mLgEBTpi9dfooQ6TB9gc7sa4qiIuuxmqQYoTx8nQQ1StAzFu93g06A==',
      headers: { 
        'Content-Type': 'application/json'
      },
      data : data
    };
    
    
    axios.request(config)
    .then((response) => {
      console.log(JSON.stringify(response.data));
    })
    .catch((error) => {
      console.log(error);
    });
    							
    						
    Sample API Response:
    							
    								{
    “FailRules”: [],
    “Data”: {
    “SignRequestId”: “01HV6MEARQD3X8ZXXX5FR3YDB8”,
    “RequestNo”: “KAiZEN-118”
    }
    }
    							
    						

    Once the request is accepted, a unique request ID is returned. If a callback URL is provided, a signed PDF will be sent to the specified endpoint after all signers have completed their actions.

    What Happens After the API Call?

    Each signer receives an email notification to begin signing, following the pre-defined order. The signing flow is intuitive and secure.

How the KAiZEN Signing Workflow Operates

  1. Check Email Inbox

    Each signer receives an email from KAiZEN with a link to sign.

    How to add Digital Signature to Salesforce Documents
  2. Click to Begin

    The email contains a secure link labeled “Sign Here” which opens the KAiZEN signing editor.

    Screenshot 2024 04 12 at 11.41.12
  3. Sign the Document

    After clicking on the “Sign Here” button. You’ll get a popup where you can choose the following methods to eSign:

    • Initials
    • Draw your signature
    • Upload an image of your signature
    • Recently Used Signs
    step2b
  4. Submit and Done

    Once you’ve placed your signature, click Submit. The next signer in the sequence will then be notified.

    signature comment scaled
  5. After All Signers Complete

    Once every signer has completed the process:

    • Each signer will receive an email with the final signed document.
    • If a callback URL was configured, a copy of the signed document will be automatically sent to that system (e.g., Java or your application).
    Screenshot 2024 04 12 at 11.53.14

Conclusion

By following these steps, you can quickly integrate e-Signatures with Node.Js applications using KAiZEN’s robust API. This integration not only simplifies your document workflows but also ensures legal compliance, security, and a seamless signing experience for your users. Whether you’re building internal tools or customer-facing platforms, adding e-Signature functionality will enhance efficiency and professionalism—without the complexity of building a signing system from scratch.

Sign up for Free
Trial today!

Try KAiZEN for free

Got a query? We're here 24/7

Scroll to Top