Docusign:无法从restapi v2中的文档创建信封 [英] Docusign : Unable to create envelope from document in restapi v2

查看:102
本文介绍了Docusign:无法从restapi v2中的文档创建信封的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试使用docusign restapi v2从pdf文档创建信封。我们可以使用XML创建信封,但是当我们尝试使用JSON时,会从docusign中收到以下错误。

We are trying to create an envelope from a pdf document using the docusign restapi v2. We can create an envelope using XML but when we try using JSON we receive the following error from docusign.

"errorCode": "ENVELOPE_IS_INCOMPLETE",
"message": "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line. Envelope definition missing."

我们要发送的整个POST都来自提琴手(已删除文件内容)。

The entire POST we are sending is below from fiddler (with the file content removed).

POST https://demo.docusign.net/restapi/v2/accounts/xxxxx/envelopes HTTP/1.1
X-DocuSign-Authentication: {"Username":"xxxxxx","Password":"xxxxx","IntegratorKey":"xxxxxx"}
Content-Type: multipart/form-data; boundary=AAA
Accept: application/json
Host: demo.docusign.net
Content-Length: 90500
Expect: 100-continue



--AAA
Content-Type: application/json
Content-Disposition: form-data
{
  "emailBlurb": "Blurb",
  "emailSubject": "Subhject",
  "documents": [
    {
      "name": "NDA.pdf",
      "documentId": "1"
    }
  ],
  "recipients": {
    "signers": [
      {
        "tabs": {
          "signHereTabs": [
            {
              "pageNumber": "1",
              "yPosition": "1",
              "xPosition": "1",
              "documentId": "1",
              "tabId": "1",
              "name": "TabName"
            }
          ]
        },
        "routingOrder": "1",
        "recipientId": "1",
        "name": "Ben",
        "email": "ben@test.com"
      }
    ]
  },
  "status": "created"
}
--AAA
Content-Type: application/pdf
Content-Disposition: file; filename="NDA.pdf"; documentId="1"

<pdf file image content goes here>

    --AAA--

据我所知JSON看起来很正确。

As far as I can tell the JSON looks correct. Is there anything wrong that we are missing here?

推荐答案

您的JSON看起来还不错,这可能是由于您有额外的CRLF一两个字符分隔请求正文中的边界。通常,这是需要隔开的方式(每个换行符是 \r\n ):

Your JSON looks ok, this might be due to you having an extra CRLF character or two separating your boundaries in your request body. In general this is how things need to be spaced out (each newline is a \r\n):

--AAA
Content-Type: application/json
Content-Disposition: form-data

<YOUR VALID JSON GOES HERE>
--AAA
Content-Type:application/pdf
Content-Disposition: file; filename="document.pdf"; documentid=1 

<DOCUMENT BYTES GO HERE>
--AAA--

很有可能在文档字节之后有多余的换行符导致您的问题。

It's quite possible that extra newline you have after your document bytes is causing your issue.

这篇关于Docusign:无法从restapi v2中的文档创建信封的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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