Ishita
Ishita

Reputation: 37

How can I download the signed documents as a combined PDF using docusign API?

This link (https://developers.docusign.com/docs/esign-rest-api/how-to/download-envelope-documents/) mentions how I can download separate documents using their document IDs. Also found a way to download the documents as a zip file. But is there a way to download them as a combined PDF using the API?

Thanks.

Upvotes: 0

Views: 2217

Answers (1)

Inbar Gazit
Inbar Gazit

Reputation: 14050

Not sure what lang you're using but C# code will be this (note "combined" option). For other langs - check my blog post

// You would need to obtain an accessToken using your chosen auth flow 
var apiClient = new ApiClient(basePath);
apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
var envelopesApi = new EnvelopesApi(apiClient);
string accountId; // accountId for your DocuSign account
string envelopeId; // envelopeId that you are working on
// produce a ZIP file with all documents including the CoC
Stream results1 = envelopesApi.GetDocument(accountId, envelopeId, "archive");
// produce a PDF combining all signed documents as well as the CoC
Stream results2 = envelopesApi.GetDocument(accountId, envelopeId, "combined");
// produce a particular document with documentId "1"
Stream results3 = envelopesApi.GetDocument(accountId, envelopeId, "1");
//TODO - use Stream to write or send the file for your use

Upvotes: 1

Related Questions