我有一个有效的Docusign集成,通过将坐标传递给Docusign API已经存在了一段时间。
但是,我想使用锚标签代替本应支持的 - 但每次我更改它时,我都会收到来自Docusign的错误说明:
{
"errorCode": "NO_DOCUMENT_RECEIVED",
"message": "The document element did not contain the encoded document, or there is a problem with the encoding. Bytes for document corresponding to documentId 1 not found in request. 'documentId=<x>' possibly missing from Content-Disposition header."
}
我看过其他帖子有这个错误,但它们总是由构建请求主体的方式引起的。但是,我在请求的其余部分没有改变任何内容 - 我只是从使用坐标转换为锚标签。
工作要求:
{"status":"sent","emailBlurb":"<EMAIL BODY GOES HERE>","emailSubject":"subject","documents":[{"name":"DocumentNameCanBeCustomised","documentId":1,"order":null}],"recipients":{"signers":[{"email":"User@example.com","name":"David","recipientId":1,"tabs":{"signHereTabs":[{"documentId":1,"xPosition":100,"yPosition":100,"pageNumber":1}],"approveTabs":[]},"routingOrder":null}]}}
请求失败:
{"status":"sent","emailBlurb":"<EMAIL BODY GOES HERE>","emailSubject":"subject","documents":[{"name":"DocumentNameCanBeCustomised","documentId":1,"order":null}],"recipients":{"signers":[{"email":"user@example.com","name":"David","recipientId":1,"tabs":{"signHereTabs":[{"documentId":1,"anchorString":"PO box 459","anchorXOffset":"0","anchorYOffset":"0","anchorIgnoreIfNotPresent":"false","anchorUnits":"inches"}],"approveTabs":[]},"routingOrder":null}]}}
任何建议都将受到赞赏 - 完整请求低于JSON以外的两个请求。
POST https://demo.docusign.net:7802/restapi/v2/accounts/688891/envelopes
Content-Length: 67039
Content-Type: multipart/form-data; boundary=BOUNDARY
Accept: application/json
Expect: 100-continue
Host: demo.docusign.net
X-DocuSign-Authentication: {"Username":"X979d5e3-778a-4a2b-b4d5-a91025d5f7ba","Password":"[omitted]","IntegratorKey":"[omitted]"}
X-Forwarded-For: 81.133.16.170
--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data
{"status":"sent","emailBlurb":"blurb","emailSubject":"subject","documents":[{"name":"DocumentNameCanBeCustomised","documentId":1,"order":null}],"recipients":{"signers":[{"email":"David@example.com","name":"David","recipientId":1,"tabs":{"signHereTabs":[{"anchorString":"userid below this","anchorXOffset":"0","anchorYOffset":"0","anchorIgnoreIfNotPresent":"false","anchorUnits":"inches"}],"approveTabs":[]},"routingOrder":null}]}}
--BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="Contract.pdf"; documentId=1
%PDF-1.5
%{{BYTES REMOVED}}
--BOUNDARY--
400 BadRequest
Content-Type: application/json; charset=utf-8
{ "errorCode": "NO_DOCUMENT_RECEIVED",
"message": "The document element did not contain the encoded document, or there is a problem with the encoding. Bytes for document corresponding to documentId 1 not found in request. 'documentId=<x>' possibly missing from Content-Disposition header."}
谢谢, 大卫
答案 0 :(得分:1)
我建议您将特定字符串添加到文档中以用作锚点。例如“&lt;&lt;&lt; sig1&gt;&gt;” (然后将其文本颜色更改为白色,这样您就不会在文档中看到它。)
我在使用现有文本作为锚时遇到了问题,尤其是包含空格的文本。
另一个提示:尝试使用web browser DocuSign app创建一个包含相同文档的信封,并使用一个使用锚文本的签名字段。
有关详细信息,请参阅recipe。