【发布时间】:2016-04-15 19:21:27
【问题描述】:
我有一个有效的 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."}
谢谢, 大卫
【问题讨论】:
-
您发布的“工作请求”JSON 无效,请为初学者发布正确格式的 JSON。
-
假设这不是问题,我看到您正试图锚定文本
"PO box 459",对吗?如果该特定文本不在文档中的任何位置,您将收到错误消息。 -
这意味着请求完全缺少文档字节,或者您定义文档的方式存在问题。尝试包含更多请求,您可以使用文档字节的 sn-p 来缩短帖子。
-
感谢 Ergin - 我已修复 JSON(删除原始电子邮件主题时意外删除了双引号)。文本是正确的,并且确实存在于文档中 - 这只是文档中某些文本的一个示例。
-
谢谢@LuisScott - 我已经按照您的建议添加了完整的完整请求。
标签: docusignapi