← Back to list

Integrating DocuSign with Oracle Visual Builder

DocuSign is an electronic signature platform that allows users to securely sign, send, and manage documents online. It helps businesses and…

Nada Bashar · 2025-01-29 14:15 · 1 claps · 3.3 min read
#oracle-cloud #oracle-visual-builder #docusign #nodejs
Open on Medium ↗
Wiki topics: 🌐 · Web Development 🏔️ · Outdoor & Adventure

Integrating DocuSign with Oracle Visual Builder

DocuSign is an electronic signature platform that allows users to securely sign, send, and manage documents online. It helps businesses and individuals eliminate the need for physical paperwork by providing legally binding e-signatures.

What if we want to upload documents in Oracle Visual Builder, send them to DocuSign for signing, and then download the signed document back in Oracle Visual Builder? Let’s walk through the process step by step

We will use the DocuSign Node.js SDK to make three API calls:

  1. Create an Envelope
  2. Retrieve the Envelope Status
  3. Download the Signed Document

To use any of these APIs, we first need to obtain a JWT authentication token. For this, you will need the DOCUSIGN_CLIENT_ID, DOCUSIGN_USER_ID, and a private key.

First go to: https://developers.docusign.com/ and create a developer account if you don’t already have one

Then go to “My Apps & Keys”

Scroll down and under “Integrations” you will find “Apps & Keys”

The User ID is your “DOCUSIGN_USER_ID”

After that click on “Add App and Integration Key”

You will find “Integration Key” which is your “DOCUSIGN_CLIENT_ID” ,

then under “Service Integration” click the “Generate RSA” button and save your private key in a .pem file in your local machine

Last thing you need is the base URL which is “https://demo.docusign.net/restapi”

And now you are ready to authenticate with JWT

const authenticateWithJWT = async () => {

  const apiClient = new docusign.ApiClient();

  apiClient.setBasePath(process.env.DOCUSIGN_BASE_URL);

  const privateKey = fs.readFileSync('./private.pem', 'utf8');

  try {
    const results = await apiClient.requestJWTUserToken(
      process.env.DOCUSIGN_CLIENT_ID,
      process.env.DOCUSIGN_USER_ID,
      "signature",
      privateKey,
      3600
    );

    apiClient.addDefaultHeader("Authorization", `Bearer ${results.body.access_token}`);

    return apiClient;
  } catch (error) {
    console.error("Authentication error:", error);
    throw error;
  }
};

To create an envelope in DocuSign after generating the token:

const createEnvelope = async (apiClient,envelopeBody) => {
  const envelopesApi = new docusign.EnvelopesApi(apiClient);

  const envelopeDefinition = envelopeBody;
  try {
    const envelopeSummary = await envelopesApi.createEnvelope(process.env.DOCUSIGN_ACCOUNT_ID, {
      envelopeDefinition,
    });

    const envelopeId = envelopeSummary.envelopeId;
    return {"envelopeId" : envelopeId};
  } catch (error) {
    console.error("Error creating envelope:", error);
    throw error;
  }
};

/* Envelope Body Example */

/* {
  "documents": [
    {
      "documentBase64": //your document base64,
      "documentId": "1",
      "fileExtension": "pdf",
      "name": "document"
    }
  ],
  "emailSubject": "Test From Nodejs",
  "recipients": {
    "signers": [
      {
        "email": //signer email,
        "name": //signer name,
        "recipientId": "1"
      }
    ]
  },
  "status": "sent"
}
*/

To get signed document from DocuSign:

async function getDocumentFromEnvelope(envelopeId,documentId) {
  const { DOCUSIGN_ACCOUNT_ID } = process.env;

  // Initialize the API client
  const apiClient = await authenticateWithJWT();

  // Initialize the Envelopes API
  const envelopesApi = new docusign.EnvelopesApi(apiClient);

  try {
    // Get the document from the envelope
    const documentBytes = await envelopesApi.getDocument(
      DOCUSIGN_ACCOUNT_ID, // Your account ID
      envelopeId, // The envelope ID
      documentId  // The document ID (typically '1' for the first document)
    );


     const base64String = documentBytes.toString('base64');


    return {"documentBase64" : base64String};

  } catch (error) {
    console.error('Error retrieving document:', error.response?.text || error.message);
    return 'Error retrieving document:', error.response?.text || error.message;
  }
}

To get envelope status from DocuSign:

async function envelopeStatus(envelopeId) {
  try {
    // Authenticate using JWT
    const apiClient = await authenticateWithJWT();

    // Extract DocuSign Account ID
    const { DOCUSIGN_ACCOUNT_ID } = process.env;

    // Initialize the Envelopes API
    const envelopesApi = new docusign.EnvelopesApi(apiClient);

    // Fetch Envelope Status
    const envelope = await envelopesApi.getEnvelope(DOCUSIGN_ACCOUNT_ID, envelopeId);

    console.log(`Envelope Status: ${envelope.status}`);

    // Send Response
    return { status: envelope.status };

  } catch (error) {
    console.error('Error retrieving envelope status:', error.response?.text || error.message);

    // Send error response
    return { status: 'Failed to fetch envelope status' }

  }
}

Then you can create service connections in your Oracle Visual Builder and add your APIs then using File Picker upload your document, convert it to base64 and send it to DocuSign

I hope you found this helpful 😄


메타데이터
post_id
71da619f09c7
slug
integrating-docusign-with-oracle-visual-builder-71da619f09c7
url
https://medium.com/@nadabashar6/integrating-docusign-with-oracle-visual-builder-71da619f09c7
canonical_url
https://medium.com/@nadabashar6/integrating-docusign-with-oracle-visual-builder-71da619f09c7
author_url
https://medium.com/@nadabashar6
status
ok
fetched_at
2026-07-15 12:14:37