Adding Multiple Documents with Meta Data
Monday, February 5, 2018 at 10:21amWe are trying to add multiple documents with Meta Data to the REST API in a single call.
We are able to add a single document with meta data using a call like
POST /api/packages/CexKAcIADCrhmET2TheZdEtnnQA=/documents/ HTTP/1.1
Host: sandbox.esignlive.com
Authorization: Basic XXXXXXXXXXXXXXXXXXXXX
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Cache-Control: no-cache
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="payload"
{
"description": "A test document 1.",
"name": "45-Sold Notice.pdf"
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="3-Sold Notice.pdf"
Content-Type: application/pdf
We are able to add multiple files using a call like
POST /api/packages/CexKAcIADCrhmET2TheZdEtnnQA=/documents/ HTTP/1.1 Host: sandbox.esignlive.com Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXX Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="files[]"; filename="3-Sold Notice.pdf" Content-Type: application/pdf ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="files[]"; filename="9-Bill Of Sale.pdf" Content-Type: application/pdf ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="files[]"; filename="24-Power of Attorney.pdf" Content-Type: application/pdf ------WebKitFormBoundary7MA4YWxkTrZu0gW--What we cannot seem to do is add multiple documents to a package in one call. changing the payload to be an array results in an error payload
{"documents" : [{
"description": "A test document 1.",
"name": "45-Sold Notice.pdf"
}, {
"description": "A test document 1.",
"name": "46-Sold Notice.pdf"
}, {
"description": "A test document 1.",
"name": "47-Sold Notice.pdf"
}
]}
response
{
"messageKey": "error.validation.addDocument.documentNameEmpty",
"message": "Document name cannot be empty.",
"code": 400,
"name": "Validation Error"
}
we have tried multiple other ways, none with any success.
Reply to: Adding Multiple Documents with Meta Data
Monday, February 5, 2018 at 10:58amReply to: Adding Multiple Documents with Meta Data
Tuesday, February 6, 2018 at 09:22am