任何人都可以为createAndSendenvelope提供示例顶点代码REST API示例。我正在使用演示DocuSign沙箱,我收到INCOMPLETE ENVELOPE错误。我的信封里面有所有必需的元素,所以想看看我错过了什么,或者我是不是以正确的方式创建它。下面是我作为请求传递的json,我得到回复:“信封不完整。完整的信封需要文档,收件人,标签和主题行.Content-Type不包含边界参数。”
--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data
{
"status": "created",
"recipients": {
"signers": [{
"tabs": {
"signHeretabs": [{
"yPosition": "15",
"xPosition": "249",
"width": "100",
"tablabel": null,
"required": "TRUE",
"recipientId": "1",
"pagenumber": "1",
"fontSize": "Size12",
"font": "Calibri",
"documentid": "1",
"anchorYoffset": null,
"anchorXOffset": null,
"anchorUnits": "pixels",
"anchorString": "Sign Here",
"anchorIgnoreIfNotPresent": "true"
}],
"initialsTabs": [{
"yPosition": "45",
"xPosition": "249",
"width": "100",
"tablabel": null,
"required": "TRUE",
"receipientId": "1",
"pagenumber": "1",
"fontSize": "Size12",
"font": "Calibri",
"documentId": "1",
"anchorYoffset": null,
"anchorXOffset": null,
"anchorUnits": "pixels",
"anchorString": "Initials Here",
"anchorIgnoreIfNotPresent": "true"
}],
"dateSignedTabs": [{
"yPosition": "65",
"xPosition": "249",
"width": "100",
"tablabel": null,
"required": "TRUE",
"receipientid": "1",
"pagenumber": "1",
"fontSize": "Size12",
"font": "Calibri",
"documentid": "1",
"anchorYoffset": "-5",
"anchorXOffset": null,
"anchorUnits": "pixels",
"anchorString": "Date Signed",
"anchorIgnoreIfNotPresent": "true"
}]
},
"routingorder": "1",
"rolename": "First Signer",
"recipientid": "1",
"name": "Marisol L Testcase",
"email": "testfd1@gcpa.com"
}]
},
"emailsubject": "TestDocuSign Call",
"emailBlurb": "Test Email Blurb",
"documents": [{
"name": "Name1",
"fileExtension": ".txt",
"documentId": "1",
"documentBase64": null
}]
}
--BOUNDARY
Content-Type: application/octet-stream
Content-Disposition: file; filename="Name1"; documentid=1
Content-Transfer-Encoding: base64
VGhpcyBpcyBhIHNhbXBsZSBmaWxlIHVwbG9hZCBmb3IgdGVzdGluZy4=
--BOUNDARY--
更新:我可以摆脱边界参数错误,现在得到“信封不完整。完整的信封需要文档,收件人,标签和主题行。信封定义缺失。 “
答案 0 :(得分:0)
您不应将"documentBase64": null
放入"文件"节点,因为您已将文档作为多部分请求传递,"fileExtension"
应为"txt" not ".txt"
。现在进入制表符分配,你混合了两个策略,一个是X / Y位置,另一个是Anchor String。您应该使用其中一个,X / Y位置将DocuSign选项卡放在指定的X/Y position
,而AnchorString
将尝试在文档中找到该字符串,如果找到,则附加DocuSign选项卡它。并且没有后退策略,意味着如果锚定字符串不可用则放入X / Y位置,这是不可能的。因此,要么您的文档应该有锚字符串,那么请使用Anchor String策略,从JSON中删除与Anchor字符串相关的属性,并根据X / Y位置放置标记。