简体   繁体   English

与锚标签进行Docusign集成

[英]Docusign integration with anchor tags

I have a working Docusign integration, which has been in place for some time by passing co-ordinates to the Docusign API. 我有一个有效的Docusign集成,通过将坐标传递给Docusign API已经建立了一段时间。

However, I would like to use anchor tags instead which is supposed to be supported - yet every time I change it, I get an error from Docusign stating: 但是,我想改用应该支持的锚标记-但是,每次更改它时,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."
}

I have seen other posts with this error, but they are always caused by the way the body of the request is built. 我看到过其他带有此错误的帖子,但它们始终是由构建请求正文的方式引起的。 However, I am changing nothing in the rest of the request - I am simply changing from using co-ordinates to anchor tags. 但是,在请求的其余部分中,我什么都没改变-我只是从使用坐标来锚定标签而已。

Working request: 工作要求:

{"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}]}}

Failing request: 失败请求:

{"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}]}}

Any advise would be appreciated - the full request is below and is the same for both requests other than the JSON. 任何建议将不胜感激-完整的请求在下面,并且与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."}

Thanks, David 谢谢大卫

I recommend that you add a specific string to the document for use as an anchor. 我建议您将特定的字符串添加到文档中以用作锚点。 Eg "<<sig1>>" (And then change its text color to white so you won't see it in the doc.) 例如,“ << sig1 >>”(然后将其文本颜色更改为白色,这样您就不会在文档中看到它。)

I've had problems with using existing text as an anchor, especially text with spaces in it. 我在使用现有文本作为锚点时遇到了问题,尤其是其中带有空格的文本。

Another tip: try using the web browser DocuSign app to create an envelope, with the same document, with a Signing Field that uses the anchor text. 另一个提示:尝试使用网络浏览器DocuSign应用程序创建一个信封,该信封具有与使用锚文本的“签名字段”相同的文档。

For more information, see the recipe . 有关更多信息,请参见食谱

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM