Retrieving Documents

This guide shows you how to retrieve your documents.

Any documents uploaded during the creation of a document package can be downloaded at any given time.

The Code

The EslClient.downloadDocument() method can be called both before and after the package’s completion. If called before, the documents will be flattened, removing all pending signatures and fields.

FileOutputStream stream1 = new FileOutputStream("C:/Users/hhaidary/Desktop/Example/signed_document.pdf");

// Retrieve the bytes of the document (with fields)
byte[] pdfDocumentBytes = eslClient.downloadDocument(packageId, documentId);
	    
try{
    stream1.write(pdfDocumentBytes);
} finally {
    stream1.close();
}

The EslClient.downloadOriginalDocument() method can be called both before and after the package’s completion. It retrieves the original document that was uploaded by the sender, without any signatures and fields.

FileOutputStream stream2 = new FileOutputStream("C:/Users/hhaidary/Desktop/Example/original_document.pdf");

// Retrieve the bytes of the original document (without fields)
byte[] originalPdfDocumentBytes = eslClient.downloadOriginalDocument(packageId, documentId);
	    
try{
    stream2.write(originalPdfDocumentBytes);
} finally {
    stream2.close();
}

The EslClient.downloadZippedDocuments() method can only be called after all signing has been completed. Once called, the method will deliver an archive containing all signed documents.

FileOutputStream stream3 = new FileOutputStream("C:/Users/hhaidary/Desktop/Example/signed_documents.zip");

// Retrieve the bytes of the zipped file containing all the documents in the package
byte[] zippedDocumentsBytes = eslClient.downloadZippedDocuments(packageId);
	    
try{
    stream3.write(zippedDocumentsBytes);
} finally {
    stream3.close();
}

The EslClient.downloadEvidenceSummary() method can be called both before and after the package’s completion. It retrieves the current audit trail activity for the package.

FileOutputStream stream4 = new FileOutputStream("C:/Users/hhaidary/Desktop/Example/evidence_summary.pdf");

//Retrieve the bytes of the evidence summary
byte[] evidenceBytes = eslClient.downloadEvidenceSummary(packageId);
	    
try{
    stream4.write(evidenceBytes);
} finally {
    stream4.close();
}

Running Your Code

Once you’ve run your code, you will find your files in the location where you chose to save your files.

var-122

Get the Code

Any documents uploaded during the creation of a document package can be downloaded at any given time.

The Code

The EslClient.DownloadDocument() method can be called both before and after the package’s completion. If called before, the documents will be flattened, removing all pending signatures and fields.

// Retrieve the bytes of the document (with fields)
byte[] pdfDocumentBytes = eslClient.DownloadDocument(packageId, documentId);
File.WriteAllBytes("C:/Users/hhaidary/Desktop/Example/signed_document.pdf", pdfDocumentBytes);

The EslClient.DownloadOriginalDocument() method can be called both before and after the package’s completion. It retrieves the original document that was uploaded by the sender, without any signatures and fields.

// Retrieve the bytes of the original document (without fields)
byte[] originalPdfDocumentBytes = eslClient.DownloadOriginalDocument(packageId, documentId);
File.WriteAllBytes("C:/Users/hhaidary/Desktop/Example/original_document.pdf", originalPdfDocumentBytes);

The EslClient.DownloadZippedDocuments() method can only be called after all signing has been completed. Once called, the method will deliver an archive containing all signed documents.

// Retrieve the bytes of the zipped file containing all the documents in the package
byte[] zippedDocumentsBytes = eslClient.DownloadZippedDocuments(packageId);
File.WriteAllBytes("C:/Users/hhaidary/Desktop/Example/signed_documents.zip", zippedDocumentsBytes);

The EslClient.DownloadEvidenceSummary() method can be called both before and after the package’s completion. It retrieves the current audit trail activity for the package.

//Retrieve the bytes of the evidence summary
byte[] evidenceBytes = eslClient.PackageService.DownloadEvidenceSummary(packageId);
File.WriteAllBytes("C:/Users/hhaidary/Desktop/Example/evidence_summary.pdf", evidenceBytes);

Running Your Code

Once you’ve run your code, you will find your files in the location where you chose to save your files.

var-122

Get the Code

Any documents uploaded during the creation of a document package can be downloaded at any given time.

The Code

The DownloadDocument() call can be called both before and after the package’s completion. If called before, the documents will be flattened, removing all pending signatures and fields.

HTTP Request
GET https://sandbox.esignlive.com/api/packages/{packageId}/documents/{documentId}/pdf

HTTP Headers
Accept: application/pdf
Content-Type: application/json
Authorization: Basic api_key

The DownloadOriginalDocument() call can be called both before and after the package’s completion. It retrieves the original document that was uploaded by the sender, without any signatures and fields.

HTTP Request
GET https://sandbox.esignlive.com/api/packages/{packageId}/documents/{documentId}/original

HTTP Headers
Accept: application/pdf
Content-Type: application/json
Authorization: Basic api_key

The DownloadZippedDocuments() call can only be called after all signing has been completed. Once called, the method will deliver an archive containing all signed documents.

HTTP Request
GET https://sandbox.esignlive.com/api/packages/{packageId}/documents/zip

HTTP Headers
Accept: application/zip
Content-Type: application/json
Authorization: Basic api_key

The DownloadEvidenceSummary() call can be called both before and after the package’s completion. It retrieves the current audit trail activity for the package.

HTTP Request
GET https://sandbox.esignlive.com/api/packages/{packageId}/evidence/summary

HTTP Headers
Accept: application/pdf
Content-Type: application/json
Authorization: Basic api_key

Running Your Code

Once you’ve run your code, you will find your files in the location where you chose to save your files.

var-122

Get the Code