Whether you’re initiating a transaction, appending your signature, or simply monitoring the progress as a CC’d recipient, accessing your finalized documents should be seamless and hassle-free. Today, we’ll explore how to download an eSignature document using BoldSign’s API. Let’s get started.
Initiating Document Download Using BoldSign API
The first step in downloading an eSignature document via the BoldSign API is to initiate the download request. This requires the document ID of the specific document you wish to download. BoldSign supports both REST API endpoints and SDKs, so you can download documents as needed. For complete details on the download endpoint and response handling, refer to the official BoldSign Download Document API documentation.
Note: When the document is created on behalf of a particular sender email, then the download operation can be performed by specifying the same sender identity email in the onBehalfOf parameter.
Since document signing is asynchronous, listen for the Completed webhook event before attempting to download to ensure the document is ready. Refer to the Webhooks documentation and the Verify Webhook Events guide for setup and security best practices.
Let’s look at how to initiate the download process using different programming languages.
Example Code for Downloading a Document
Here’s an example code snippet of how you can download a document via the BoldSign API and SDKs in various programming languages.
Note: The second argument in the downloadDocument API is onBehalfOf. Use this argument only when the document was created on behalf of another sender identity. Replace [email protected] with the actual sender identity email.
# onBehalfOf (optional): provide the sender identity email only if the document was created on behalf of another sender identity
curl -X GET
'https://api.boldsign.com/v1/document/download?documentId={YOUR_DOCUMENT_ID}[email protected]' \
-H 'accept: application/json' \
-H 'X-API-KEY: {YOUR_API_KEY}'
var apiClient = new ApiClient("https://api.boldsign.com", "YOUR_API_KEY");
var documentClient = new DocumentClient(apiClient);
// onBehalfOf: [email protected] (optional; use only if the document was created on behalf of another sender identity)
var documentStream = documentClient.DownloadDocument("YOUR_DOCUMENT_ID", "[email protected]");
import boldsign
configuration = boldsign.Configuration(api_key="YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
document_api = boldsign.DocumentApi(api_client)
# on_behalf_of (optional): provide the sender identity email only if the document was created on behalf of another sender identity
document_stream = document_api.download_document(
document_id="YOUR_DOCUMENT_ID",
on_behalf_of="[email protected]"
)
<?php
require_once "vendor/autoload.php";
use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
$config = new Configuration();
$config->setApiKey('YOUR_API_KEY');
$document_api = new DocumentApi($config);
// on_behalf_of (optional): provide the sender identity email only if the document was created on behalf of another sender identity
$document_stream = $document_api->downloadDocument($document_id = 'YOUR_DOCUMENT_ID', $on_behalf_of = '[email protected]');
ApiClient client = Configuration.getDefaultApiClient();
client.setApiKey("YOUR_API_KEY");
DocumentApi documentApi = new DocumentApi(client);
// onBehalfOf: [email protected] (optional; use only if the document was created on behalf of another sender identity)
File documentStream = documentApi.downloadDocument("YOUR_DOCUMENT_ID", "[email protected]");
import { DocumentApi } from "boldsign";
async function main() {
const documentApi = new DocumentApi();
documentApi.setApiKey("YOUR_API_KEY");
// onBehalfOf: [email protected] (optional; use only if the document was created on behalf of another sender identity)
const documentStream = await
documentApi.downloadDocument("YOUR_DOCUMENT_ID", "[email protected]");
}
main();
If you want to test the document download API quickly without any manual setup, you can use the Postman Document Download request available in the BoldSign Public Workspace.
Handling the Document Stream
After you’ve initiated the document download request, BoldSign’s API returns the document stream, which contains the eSignature document. You can then process the document stream depending on your application’s requirements. For instance, you may choose to save the document to a local file system, integrate it into another system, or display it to the user for further action.
Conclusion
In conclusion, downloading eSignature documents via the BoldSign API is convenient. By leveraging BoldSign’s API, you can seamlessly integrate document retrieval capabilities into your applications, streamlining workflow processes and enhancing the user experience. If you prefer using the BoldSign web app, you can download documents directly from BoldSign. Refer to BoldSign signed document download guide for downloading signed documents in the BoldSign web app.
Whether you’re a developer looking to integrate eSignature functionalities or a business seeking to streamline document handling, BoldSign’s API provides the necessary tools and resources to achieve your goals. Refer to the BoldSign API documentation to get started with integrating BoldSign APIs into your application.
Begin your 30-day, free BoldSign trial today to see the full potential of BoldSign. We highly value your feedback, so please share your thoughts with us in the comments section. For any inquiries or to explore our services further, don’t hesitate to schedule a demo or reach out to our dedicated support team through our support portal. We’re here to assist you every step of the way.
