This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Envelope Documents


Overview

The following operations allow you to work with envelope documents. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to carry out operations on envelope documents, see Sample configuration.

OperationDescription

listEnvelopeDocuments

Gets a list of all documents from an envelope

getDocumentFromAnEnvelope

Gets the specified document from an envelope
getDocumentFromAnEnvelopeGets the specified document from an envelope
envelopeDocumentsUpdateListAdds one or more documents to an existing envelope document.

Operation details

This section provides details on each of the operations.

Getting a list of envelope documents

The listEnvelopeDocuments operation allows you to gets a list of documents from an envelope.

listEnvelopeDocuments
<docusign.listEnvelopeDocuments>
    <accountId>{$ctx:accountId}</accountId>
    <envelopeId>{$ctx:envelopeId}</envelopeId>
</docusign.listEnvelopeDocuments>
Properties
  • accountId :  The ID of the account. This information was returned in the login response.

  • envelopeId: The ID of the envelope whose documents you want to retrieve.

Sample request

Following is a sample REST request that can be handled by the listEnvelopeDocuments operation.

listEnvelopeDocuments
{
	"apiUrl":"https://demo.docusign.net",
	"apiVersion":"v2",
	"integratorKey":"37f2a694-cf45-4cb3-8ee6-1396b9e75739",
	"userName":"thulas@gmail.com",
	"password":"XXXXXXXXXXXXX",
	"accountId":"1910007",
	"envelopeId":"18f8c59c-da74-4a59-a94d-29accc85f704"
}
Related DocuSign API documentation

https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeDocuments/list/

Getting a specific document from an envelope

The getDocumentFromAnEnvelope operation allows you to retrieve the specified document from an envelope.

getDocumentFromAnEnvelope
<docusign.getDocumentFromAnEnvelope>
    <accountId>{$ctx:accountId}</accountId>
    <envelopeId>{$ctx:envelopeId}</envelopeId>
    <documentId>{$ctx:documentId}</documentId>
</docusign.getDocumentFromAnEnvelope>
Properties
  • accountId: The ID of the account.

  • envelopeId: The ID of the envelope that contains the document.
  • documentId: The ID of the document to retrieve.
Sample request

Following is a sample REST request that can be handled by the getDocumentFromAnEnvelope operation.

getDocumentFromAnEnvelope
{
	"apiUrl":"https://demo.docusign.net",
	"apiVersion":"v2",
    "integratorKey":"37f2a694-cf45-4cb3-8ee6-1396b9e75739",
	"userName":"thulas@gmail.com",
	"password":"XXXXXXXXXXXXX",	"accountId":"1910007",
	"envelopeId":"18f8c59c-da74-4a59-a94d-29accc85f704",
	"documentId":"1"
}
Related DocuSign API documentation

https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeDocuments/get/

Add documents to existing envelope using multipart/form-data

The envelopeDocumentsUpdateList operation allows you to adds one or more documents to an existing envelope document using multipart/form-data.

envelopeDocumentsUpdateList
<docusign.envelopeDocumentsUpdateList>
    <accountId>{$url:accountId}</accountId>
    <envelopeId>{$url:envelopeId}</envelopeId>
    <applyDocumentFields>{$url:applyDocumentFields}</applyDocumentFields>
</docusign.envelopeDocumentsUpdateList>

Properties

  • accountId: The account ID. This information is returned in the login response.

  • envelopeId: The ID of the envelope that contains the document.
  • applyDocumentFields: When true, document fields can be added or modified while adding or modifying envelope documents.
Sample request

Following is a sample REST request that can be handled by the envelopeDocumentsUpdateList operation.

envelopeDocumentsUpdateList
--AAA
Content-Disposition: form-data
Content-Type: application/json
{
  "documents": [
    {
      "documentId": "3",
      "name": "sampleDoc.pdf",
      "transformPdfFields": "false"
    }
  ]
}
--AAA
Content-Disposition: attachment; filename="sampleDoc.pdf"; documentId="3"
Content-Type: application/pdf
VGhlIEJTQiBudW1iZXIgaWRlbnRpZmllcyBhIGJyYW5jaCBvZiBhIGZpbmFuY2lhbCBpbnN0aXR1dGlvbiBpbiBBdXN0cmFsaWEu

--AAA--

Note

envelopeDocumentsUpdateList operation supports to adds one or more documents to an existing envelope document with the Content-Type multipart/form-data with boundary as a pass-through  scenario.

When invoke the operation using proxy consider the following things as well.

  • Content-Type:multipart/form-data; boundary=AAA

  • Give the apiUrl, apiVersion, integratorKey, userName, password, accountId and envelopeId as URL params with the request.

Related DocuSign API documentation

https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeDocuments/updateList/

Sample configuration

Following is a sample proxy service that illustrates how to connect to DocuSign with the init operation and use the getDocumentFromAnEnvelope operation. The sample request for this proxy can be found in getDocumentFromAnEnvelope sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="createList"
       transports="https http"
       startOnLoad="true"
       trace="disable">
   <description/>
   <target>
      <inSequence>
        <property name="apiUrl" expression="json-eval($.apiUrl)"/>
		<property name="apiVersion" expression="json-eval($.apiVersion)"/>
		<property name="integratorKey" expression="json-eval($.integratorKey)"/>
		<property name="userName" expression="json-eval($.userName)"/>
		<property name="password" expression="json-eval($.password)"/>
		<property name="blocking" expression="json-eval($.blocking)"/>
		<property name="accountId" expression="json-eval($.accountId)"/>
		<property name="envelopeId" expression="json-eval($.envelopeId)"/>
		<property name="documentId" expression="json-eval($.documentId)"/>
      	<docusign.init>
    		<apiUrl>{$ctx:apiUrl}</apiUrl>
    		<apiVersion>{$ctx:apiVersion}</apiVersion>
 			<integratorKey>{$ctx:integratorKey}</integratorKey>
    		<userName>{$ctx:userName}</userName>
   			<password>{$ctx:password}</password>   		
			<blocking>{$ctx:blocking}</blocking>
	    </docusign.init>
        <docusign.getDocumentFromAnEnvelope>
        	<accountId>{$ctx:accountId}</accountId>
    		<envelopeId>{$ctx:envelopeId}</envelopeId>
    		<documentId>{$ctx:documentId}</documentId>
	    </docusign.getDocumentFromAnEnvelope>
         <respond/>
      </inSequence>
      <outSequence>
         <log/>
         <send/>
      </outSequence>
   </target>
   <parameter name="serviceType">proxy</parameter>
</proxy>