使用 BoldSign API 轻松下载已签署的文档
发布: (2025年12月17日 GMT+8 14:44)
2 min read
原文: Dev.to
Source: Dev.to
使用 BoldSign API 发起文档下载
通过 BoldSign API 下载已完成的电子签名文档的第一步是发起下载请求。这需要您想要下载的特定文档的 document ID。BoldSign 提供 REST API,您可以使用任何服务器端编程语言来调用这些端点。
代码示例
cURL
curl -X GET 'https://api.boldsign.com/v1/document/download?documentId={Your document Id}' \
-H 'accept: application/json' \
-H 'X-API-KEY: {your-api-key}'
C#
var apiClient = new ApiClient("https://api.boldsign.com", "Your API-KEY");
var documentClient = new DocumentClient(apiClient);
var documentStream = documentClient.DownloadDocument("{Your document Id}");
Python
import requests
url = "https://api.boldsign.com/v1/document/download?documentId={Your document Id}"
headers = {
"accept": "application/json",
"X-API-KEY": "{your API key}"
}
response = requests.get(url, headers=headers)
print(response.text)
Node.js
const axios = require('axios');
const response = axios.get('https://api.boldsign.com/v1/document/download', {
params: { documentId: '{Your document Id}' },
responseType: 'stream',
headers: {
accept: 'application/json',
'X-API-KEY': '{your API key}'
}
});
PHP
'application/json',
'X-API-KEY' => '{your-api-key}'
];
$request = new Request('GET', 'https://api.boldsign.com/v1/document/download?documentId={Your document Id}', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
处理文档流
发起下载请求后,BoldSign 的 API 会返回一个包含已完成电子签名文档的 document stream。您可以根据应用需求处理该流,例如保存到本地文件系统、集成到其他系统,或向用户展示。
结论
通过 BoldSign API 下载已完成的电子签名文档非常简便,且可以无缝集成到您的工作流中。利用 API,您可以实现文档检索自动化、流程优化,并提升整体用户体验。
请参考 BoldSign API 文档 开始将 BoldSign API 集成到您的应用中。
立即开始您的 30 天免费 BoldSign 试用,或 预约演示 进一步了解平台。如需更多帮助,请访问 BoldSign 支持门户。