首页 > 解决方案 > 如何使用 docusign API 将已签名的文档下载为合并的 PDF?

问题描述

此链接(https://developers.docusign.com/docs/esign-rest-api/how-to/download-envelope-documents/)提到了如何使用文档 ID 下载单独的文档。还找到了一种将文档下载为 zip 文件的方法。但是有没有办法使用 API 将它们下载为合并的 PDF?

谢谢。

标签: docusignapi

解决方案


不确定您使用的是什么语言,但 C# 代码将是这个(注意“组合”选项)。对于其他语言 - 检查我的博客文章

// 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

推荐阅读