Docusign Multipart表单请求上载多个文档

时间:2014-12-02 17:24:13

标签: json docusignapi multipartform-data

有人可以帮助我使用Json请求在信封中上传多个文件。我已粘贴下面的请求。

我得到的错误是 API调用失败,返回状态为:400 错误描述:
{“errorCode”:“NO_DOCUMENT_RECEIVED”,“message”:“文档元素不包含编码文档,或者编码存在问题。对应于documentId 1的文档的字节在请求中找不到。”documentId ='可能Content-Disposition标头中缺少。“}

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

{
  "emailSubject" : "This is email subject",
  "emailBlurb" : "This is email body",
  "recipients" : {
    "signers" : [ {
      "routingOrder" : "1",
      "name" : "name",
      "email" : "valid email address",
      "recipientId" : "1",
      "tabs" : {
        "signHereTabs" : [ {
          "anchorTab" : {
            "anchorString" : "SignHere",
            "anchorXOffset" : "1",
            "anchorYOffset" : "1",
            "anchorIgnoreIfNotPresent" : "true",
            "anchorUnits" : "inches"
          }
        } ]
      }
    } ]
  },
  "documents" : [ {
    "name" : "document.pdf",
    "documentId" : "1"
  }, {
    "name" : "document2.pdf",
    "documentId" : "2"
  } ],
  "status" : "sent"
}

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

--BBB 

Content-Type: application/pdf
Content-Disposition: file; filename="document.pdf"; documentid="1"

[B@47df4d31
--BBB 

Content-Type: application/pdf
Content-Disposition: file; filename="document2.pdf"; documentid="2"

[B@1544f0d4
--BBB-- 

--BOUNDARY--

0 个答案:

没有答案