通过DocuSign Rest API创建DocuSign信封时出错(具有多个文档和多个收件人) [英] Error creating DocuSign Envelope via DocuSign Rest API (with multiple documents and multiple recipients)

查看:114
本文介绍了通过DocuSign Rest API创建DocuSign信封时出错(具有多个文档和多个收件人)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用DocuSign REST API在DocuSign中创建包含多个文档的信封,我使用的是multipart/form-data请求,我使用JSON定义信封的属性,我检查了JSON,认为还可以.在此之下,我定义了一个多部分/混合部分,在其中设置文档的标题和PDF字节.我收到一个错误请求错误代码,上面写着"NO_DOCUMENT_RECEIVED",并显示消息文档元素不包含编码后的文档,或者编码有问题.".我从下面的提琴手发布请求结果:

I am trying to create an Envelope in DocuSign with multiple documents using the DocuSign REST API, I'm using a multipart/form-data request, I use JSON to define the attributes of the envelope, I check my JSON and I think it is OK. Below that I define a multipart/mixed section where I set the header and PDF bytes of the documents. I receive a Bad Request error code that said "NO_DOCUMENT_RECEIVED" and have as message "The document element did not contain the encoded document, or there is a problem with the encoding. ". I post the request result from fiddler below:

//请求

POST https://demo.docusign.net/restapi/v2/accounts/295724/envelopes HTTP/1.1
X-DocuSign-Authentication: {"Username":"email","Password":"password","IntegratorKey":"key"}
Content-Type: multipart/form-data; boundary=9a56da749dc04804819460f6499ab80b
Accept: application/json
Host: demo.docusign.net
Content-Length: 31476
Expect: 100-continue

--9a56da749dc04804819460f6499ab80b
Content-Type: application/json
Content-Disposition: form-data

{"emailBlurb":"EMAIL BODY HERE OK OK","emailSubject":"EMAIL SUBJECT HERE IS MANDATORY","status":"sent","documents":[{"documentId":1,"name":"ABC.pdf"},{"documentId":2,"name":"AB.pdf"}],"recipients":{"signers":[{"email":"dn@brenock.com","name":"Dubhe","recipientId":"1","routingOrder":"1"},{"email":"dubhe.dnacimiento@gmail.com","name":"DubheF","recipientId":"2","routingOrder":"1"}]}}
--9a56da749dc04804819460f6499ab80b
Content-Disposition: form-data
Content-Type: multipart/mixed; boundary=e8bc9555e9634110bba63547b2552460

--e8bc9555e9634110bba63547b2552460
Content-Type: application/pdf
Content-Disposition: file; filename=ABC.pdf; documentId=1

<PDF Bytes Document 1>
--e8bc9555e9634110bba63547b2552460
Content-Type: application/pdf
Content-Disposition: file; filename=AB.pdf; documentId=2

<PDF BytesDocument Two>
--e8bc9555e9634110bba63547b2552460--
--9a56da749dc04804819460f6499ab80b--

推荐答案

您不需要这些行来定义第二个边界(或随后的对该第二个边界的任何引用):

You shouldn't need these lines that define a second boundary (or any of the subsequent references to that second boundary):

Content-Disposition: form-data
Content-Type: multipart/mixed; boundary=e8bc9555e9634110bba63547b2552460

请尝试将其删除(以及随后所有对边界 e8bc9555e9634110bba63547b2552460 的引用),以便您的请求如下所示:

Try removing that (and all subsequent references to boundary e8bc9555e9634110bba63547b2552460), so that your request looks like this:

POST https://demo.docusign.net/restapi/v2/accounts/295724/envelopes HTTP/1.1
X-DocuSign-Authentication: {"Username":"email","Password":"password","IntegratorKey":"key"}
Content-Type: multipart/form-data; boundary=9a56da749dc04804819460f6499ab80b
Accept: application/json
Host: demo.docusign.net
Content-Length: 31476
Expect: 100-continue

--9a56da749dc04804819460f6499ab80b
Content-Type: application/json
Content-Disposition: form-data

JSON_REQUEST_BODY_HERE
--9a56da749dc04804819460f6499ab80b
Content-Type:application/pdf
Content-Disposition: file; filename="ABC.pdf"; documentid=1 

DOCUMENT_1_BYTES_HERE
--9a56da749dc04804819460f6499ab80b
Content-Type:application/pdf
Content-Disposition: file; filename="AB.pdf"; documentid=2 

DOCUMENT_2_BYTES_HERE
--9a56da749dc04804819460f6499ab80b--

这篇关于通过DocuSign Rest API创建DocuSign信封时出错(具有多个文档和多个收件人)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆