0

Can someone please help me with the Json Request to upload multiple documents in a envelope. I have pasted the request below.

The error that I get is API call failed, status returned was: 400 Error description:
{ "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=' possibly missing from Content-Disposition header."}

--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--
avenirit12
  • 233
  • 2
  • 5
  • 17
  • I'm primarily familiar with the SOAP api, but the sample I found doesn't have quotes around the value for documentid in Content-Disposition. Ex: documentid=1 instead of documentid="1". Not listing as an Answer because I'm not sure that matters in JSON. – reinkesm Dec 02 '14 at 19:50
  • Did the change still the same error – avenirit12 Dec 02 '14 at 20:31
  • Fixed the problem using this post http://stackoverflow.com/questions/20510141/error-creating-docusign-envelope-via-docusign-rest-api-with-multiple-documents – avenirit12 Dec 02 '14 at 21:18

0 Answers0