我们正在使用docusign REST API处理一些问题替换文档。
我们遵循的步骤是删除文档,添加文档并添加该文档的收件人标签。
以下是我们使用的代码示例:
-- DELETE
https://demo.docusign.net/restapi/v2/accounts/xx/envelopes/11111222223333344444/documents
DELETE
X-DocuSign-Authentication : {"Username": "XXXXXX","Password": "YYYYY","IntegratorKey": "ZZZZZZZZZ"}
{
"documents": [
{
"documentId": "1"
},
{
"documentId": "2"
}
]
}
--ADD DOCUMENT
https://demo.docusign.net/restapi/v2/accounts/xx/envelopes/11111222223333344444/documents
PUT
X-DocuSign-Authentication : {"Username": "XXXXXX","Password": "YYYYY","IntegratorKey": "ZZZZZZZZZ"}
Content-Type ** multipart/form-data; charset=UTF-8; boundary=111222333444
Accept ** application/json
--111222333444
Content-Type: application/json; charset=UTF-8
Content-Disposition : form-data
{
"documents": [
{
"name": "446_BBB.pdf",
"documentId": "1",
"order": "1",
"documentFields": [
{
"name": "doctype",
"value": "cont"
}
]
},
{
"name": "747_BBB.pdf",
"documentId": "2",
"order": "2",
"documentFields": [
{
"name": "doctype",
"value": "cont"
}
]
}
]
}
--- doc bytes deletes
-- ADD TABS
https://demo.docusign.net/restapi/v2/accounts/xx/envelopes/11111222223333344444/recipients/1/tabs
POST
X-DocuSign-Authentication : {"Username": "XXXXXX","Password": "YYYYY","IntegratorKey": "ZZZZZZZZZ"}
{
"signHereTabs": [
{
"anchorString": "<SIGNATURE_1/>",
"anchorXOffset": "0",
"anchorYOffset": "7",
"documentId": "1",
"pageNumber": "1"
}
],
"textTabs": [
{
"documentId": "2",
"pageNumber": "1",
"xPosition": "109",
"yPosition": "656",
"tabLabel": "Name of depository",
"disableAutoSize": "true",
"name": "Name of depository",
"required": "true",
"width": "195",
"maxLength": "33"
}
],
"numberTabs": [
{
"documentId": "2",
"pageNumber": "1",
"xPosition": "420",
"yPosition": "681",
"tabLabel": "CC Account number",
"disableAutoSize": "true",
"name": "CC Account number",
"required": "true",
"width": "138",
"maxLength": "16"
}
],
"zipTabs": [
{
"documentId": "2",
"pageNumber": "1",
"xPosition": "197",
"yPosition": "690",
"tabLabel": "Depository zipcode",
"disableAutoSize": "true",
"name": "Depository zipcode",
"required": "true",
"width": "95",
"maxLength": "5"
}
]
}
我们遇到的问题如下:
我真的很感激任何帮助。
谢谢,
答案 0 :(得分:0)
文件没有保留指定的顺序
确保重新排序每个现有文档。例如:
{
"documents": [
{
"name": "446_BBB.pdf",
"documentId": "1",
"order": "1",
"documentFields": [
{
"name": "doctype",
"value": "cont"
}
]
},
{
"name": "747_BBB.pdf",
"documentId": "2",
"order": "2",
"documentFields": [
{
"name": "doctype",
"value": "cont"
}
]
},
{
"documentId": "3",
"order": "3"
}
]
}
对于标签,该过程为同一收件人创建每种类型的2个标签。
似乎是一个错误(会让你知道,否则或修复时)。要解决此问题,您可以将最后一个API请求拆分为两个单独的请求,一个仅包含signHereTabs
,另一个包含所有其他选项卡。