【问题标题】:Docusign integration with anchor tagsDocusign 与锚标签的集成
【发布时间】: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


【解决方案1】:

我建议您将特定字符串添加到文档中以用作锚点。例如“>”(然后将其文本颜色更改为白色,这样您就不会在文档中看到它。)

我在使用现有文本作为锚点时遇到了问题,尤其是其中包含空格的文本。

另一个提示:尝试使用web browser DocuSign app 创建一个信封,其中包含相同的文档,并带有一个使用锚文本的签名字段。

有关详细信息,请参阅recipe

【讨论】:

  • 我最初尝试使用 GUID - 但失败了,因此我将其更改为另一段文本作为故障排除的一部分。不过感谢您的提示 - 稍后一定会尝试并报告。
  • 完美 - 您在文本中的空格是正确的。我尝试的场景要么有空格,要么有带有不寻常分隔符的 guid(来自外部系统),两者都导致 API 发回上面不相关的错误。使用一些没有任何分隔符的文本似乎已经解决了这个问题。感谢您的提示!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-27
  • 2023-02-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多