JDBC Driver for DocuSign

Build 25.0.9434

CreateAndSendEnvelope

Creates and sends an envelope or creates a draft envelope.

Table Specific Information

Execute

Create the envelope.

The required columns to run the stored procedure are EmailSubject, DocumentId, FileLocation or Content. While parsing single signers, the SignersRecipientId column might also be required. If you use CarbonCopies, you might also need to include the CcEmail and CcRecipientId columns.

EXECUTE CreateAndSendEnvelope EmailSubject = 'Please sign this document', FileName = 'sample', DocumentId = '1', CcEmail = '[email protected]', SignersRecipientId = '1', CcRecipientId = '2', FileLocation = 'C:/Users/cdata/Downloads/sample.pdf'

If you are using a document other than PDF, DocumentFileExtension is mandatory.

EXECUTE CreateAndSendEnvelope EmailSubject = 'Please sign this document', FileName = 'sample', DocumentId = '1', DocumentFileExtension = 'docx', CcEmail = '[email protected]', SignersRecipientId = '1', CcRecipientId = '2', Content = InputStream

Create the envelope with customfields. The possible columns for customfields are CustomFieldName, CustomFieldId, CustomFieldShow, CustomFieldRequired, CustomFieldValue, CustomFieldConfigurationType, CustomFieldType and CustomFieldListItems.

INSERT INTO CreateAndSendEnvelope#TEMP (CustomFieldtest, CustomFieldValue, CustomFieldId, CustomFieldType) VALUES ('vk', 'test', 1, TextCustomFields)
EXECUTE CreateAndSendEnvelope EmailSubject = 'Please sign this document', FileName = 'sample', DocumentId = 1, CCEmail = '[email protected]', SignersRecipientId = 2, CcRecipientId = 1, FileLocation = 'C:/Users/cdata/Downloads/sample.pdf', CustomFieldAggregate = 'CreateAndSendEnvelope#TEMP' 

INSERT INTO CreateAndSendEnvelope#TEMP (CustomFieldName, CustomFieldValue, CustomFieldId, CustomFieldType) VALUES ('test2', 'test_custom',480730, TextCustomFields)
INSERT INTO CreateAndSendEnvelope#TEMP (CustomFieldName, CustomFieldValue, CustomFieldId, CustomFieldType) VALUES ('test21', 'test_custom1',480731, ListCustomFields)
EXEC CreateandSendEnvelope EmailSubject=?,CustomFieldAggregate=?","test,CreateAndSendEnvelope#TEMP

The second way of using the Stored Procedure is by adding the aggregate itself:

EXEC CreateandSendEnvelope EmailSubject=?,DocumentId=?,FileLocation='D:\\\\Raj Shekhar Gupta\\\\testing.pdf',FileName=?,CustomFieldAggregate='{\"listCustomFields\": [{\"name\": \"Customfieldstest1\",\"show\": \"true\",\"required\": \"true\",\"value\": \"anirudhtest\"}]}'","Please sign this document on priority,122,testing123"

Create the envelope with multiple values of Signers, CarbonCopies and Documents by adding the aggregate itself for SignersAggregate, CarbonCopiesAggregate and DocumentsAggregate. In case

EXEC CreateandSendEnvelope EmailSubject=?,DocumentId=?,FileLocation='D:\\\\Raj Shekhar Gupta\\\\testing.pdf',FileName=?,CarbonCopiesAggregate='[{\"email\": \"[email protected]\",\"name\": \"anirudhk\"}]',CustomFieldAggregate='{\"listCustomFields\": [{\"name\": \"Customfieldstest1\",\"show\": \"true\",\"required\": \"true\",\"value\": \"anirudhtest\"}]}',SignersAggregate='[{\"email\": \"[email protected]\",\"name\": \"raj\",\"recipientId\": \"84570874\",\"tabs\": {\"signHereTabs\": [{\"anchorYOffset\": \"10\",\"anchorString\":\"signature_1\",\"anchorUnits\": \"pixels\",\"anchorXOffset\": \"20\"}]}}]'","Please sign this document on priority,122,testing123

Create the envelope with multiple values of Documents by adding the aggregate itself for DocumentsAggregate and providing the base64encoded value for the document.

EXEC CreateandSendEnvelope EmailSubject='Please reply',CarbonCopiesAggregate='[{\"email\": \"[email protected]\",\"recipientId\": \"7\",\"name\": \"anirudhk\"}]',DocumentsAggregate='[{\"documentBase64\": \"encoded\",\"name\": \"testing\",\"documentId\": \"122\"},{\"documentBase64\": \"encoded\",\"documentId\": \"124\",\"name\":\"anirudh\"}]';
Note: When using this stored procedure, please avoid including a suffix for the file in the FileName input (such as DOCX, PDF, or HTML). Use DocumentFileExtension instead.

Input

Name Type Required Accepts Input Streams Description
Status String False False Set the status to 'sent' to send the envelope to recipients immediately, or set the status to 'created' to save the envelope as a draft. The default value is 'created'.

The allowed values are sent, created.

EmailSubject String True False The subject line of the email sent to recipients with the envelope.
DocumentId String False False The unique identifier for the document within the envelope.
DocumentFileExtension String False False The file extension of the document. This input is mandatory if the file is not a PDF.

The allowed values are docx, pdf, html.

FileLocation String False False The file location, such as 'C:\File.pdf'. Use if not providing a stream.
Content String False True The input stream containing the binary content of the document. Use this when FileLocation is not provided.
FileName String False False The name of the document file. Required if Content is provided. Do not include a file extension here. Use DocumentFileExtension instead.
SignersEmail String False False The email Id of the document's signer.
SignersRoutingOrder String False False The routing order for the document's signers.
SignersRecipientId String False False The signer's recipient Id.
SignersName String False False The full name of the document signer.
CcEmail String False False The email Id of the carbon copy (CC) recipient.
CcName String False False The full name of the CC recipient.
CcRecipientId String False False The Id of the CC recipient.
CcRoutingOrder String False False The routing order for the CC recipients.
CustomFieldAggregate String False False Aggregated custom field data. The possible columns are CustomFieldName, CustomFieldId, CustomFieldShow, CustomFieldRequired, CustomFieldValue, CustomFieldConfiguration, and CustomFieldListItems.
CarbonCopiesAggregate String False False A structured list of CC recipients. Use instead of individual CC fields for bulk operations.
SignersAggregate String False False A structured list of signers with full metadata. Use instead of individual signer fields for bulk signer input.
DocumentsAggregate String False False A structured list of documents to include in the envelope. Use when sending multiple documents.

Result Set Columns

Name Type Description
Success String Determines whether the operation was successful.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434