v1

latestSwagger 2.02026-07-134146194.6 MB
EnvelopeDocuments

Retrieves a single document or all documents from an envelope.

Retrieves a single document or all documents from an envelope.

To retrieve a single document, provide the ID of the document in the documentId path parameter. Alternatively, by setting the documentId parameter to special keyword values, you can retrieve all the documents (as a combined PDF, portfolio PDF, or ZIP archive) or just the certificate of completion. See the documentId description for how to retrieve each format.

The response body of this method is a file. If you request multiple documents, the result is a ZIP archive that contains all of the documents.

In all other cases, the response is a PDF file or PDF portfolio.

You can get the file name and document ID from the response's Content-Disposition header:

Content-Disposition: file; filename="NDA.pdf"; documentid="1

By default, the response is the PDF file as a byte stream. For example a request/response in curl looks like this:

$ curl --request GET 'https://demo.docusign.net/restapi/v2/accounts/0cdb3ff3-xxxx-xxxx-xxxx-e43af011006d/envelopes/ea4cc25b-xxxx-xxxx-xxxx-a67a0a2a4f6c/documents/1/' \
       --header 'Authorization: Bearer eyJ...bqg'


HTTP/1.1 200 OK
Content-Length: 167539
Content-Type: application/pdf
. . .
Content-Disposition: file; filename="Lorem_Ipsum.pdf"; documentid="1"
Date: Tue, 23 Aug 2022 01:13:15 GMT

%PDF-1.4
%˚¸˝˛
6 0 obj
<</Length 14>>stream
. . .

By using the Content-Transfer-Encoding header in the request, you can obtain the PDF file encoded in base64. The same curl request with the base64 header would look like this:

$ curl --request GET 'https://demo.docusign.net/restapi/v2/accounts/0cdb3ff3-xxxx-xxxx-xxxx-e43af011006d/envelopes/ea4cc25b-xxxx-xxxx-xxxx-a67a0a2a4f6c/documents/1/' \
       --header 'Authorization: Bearer eyJ...bqg' \
       --header 'Content-Transfer-Encoding: base64'


HTTP/1.1 200 OK
Content-Length: 223384
Content-Type: application/pdf
. . .
Content-Disposition: file; filename="Lorem_Ipsum.pdf"; documentid="1"
Content-Transfer-Encoding: base64
Date: Tue, 23 Aug 2022 01:12:30 GMT

JVBERi0xLjQKJfv8/f4KNiAwIG9iago8PC9MZW. . .==

(In an actual curl request you would use the --output switch to save the byte stream into a file.)

Related topics

  • How to download envelope documents
get/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}

Path parameters

accountIdstring required

The external account number (int) or account ID GUID.

documentIdstring required

The ID of the document to retrieve. Alternatively, you can use one of the following special keywords:

  • combined: Retrieves all of the documents as a single PDF file. When the query parameter certificate is true, the certificate of completion is included in the PDF file. When the query parameter certificate is false, the certificate of completion is not included in the PDF file.
  • archive: Retrieves a ZIP archive that contains all of the PDF documents and the certificate of completion.
  • certificate: Retrieves only the certificate of completion as a PDF file.
  • portfolio: Retrieves the envelope documents as a PDF portfolio.
envelopeIdstring required

The envelope's GUID.

Example: 93be49ab-xxxx-xxxx-xxxx-f752070d71ec

Query parameters

certificatestring

Used only when the documentId parameter is the special keyword combined.

When true, the certificate of completion is included in the combined PDF file. When false, (the default) the certificate of completion is not included in the combined PDF file.

documents_by_useridstring

When true, allows recipients to get documents by their user id. For example, if a user is included in two different routing orders with different visibilities, using this parameter returns all of the documents from both routing orders.

encodingstring

Reserved for Docusign.

encryptstring

When true, the PDF bytes returned in the response are encrypted for all the key managers configured on your Docusign account. You can decrypt the documents by using the Key Manager DecryptDocument API method. For more information about Key Manager, see the Docusign Security Appliance Installation Guide that your organization received from Docusign.

languagestring

Specifies the language for the Certificate of Completion in the response. The supported languages are: Chinese Simplified (zh_CN), Chinese Traditional (zh_TW), Dutch (nl), English US (en), French (fr), German (de), Italian (it), Japanese (ja), Korean (ko), Portuguese (pt), Portuguese (Brazil) (pt_BR), Russian (ru), Spanish (es).

recipient_idstring

Allows the sender to retrieve the documents as one of the recipients that they control. The documents_by_userid parameter must be set to false for this functionality to work.

shared_user_idstring

The ID of a shared user that you want to impersonate in order to retrieve their view of the list of documents. This parameter is used in the context of a shared inbox (i.e., when you share envelopes from one user to another through the Docusign Admin console).

show_changesstring

When true, any changed fields for the returned PDF are highlighted in yellow and optional signatures or initials outlined in red. The account must have the Highlight Data Changes feature enabled.

watermarkstring

When true, the account has the watermark feature enabled, and the envelope is not complete, then the watermark for the account is added to the PDF documents. This option can remove the watermark.

Response

Successful response.