Receiving Error "Number of uploaded files does not match number of documents specified in package."
Thursday, June 11, 2020 at 11:37amI am trying to create a package and upload a document but I only get the error message "Number of uploaded files does not match number of documents specified in package." I have looked through the API and other posts about this error message. I have even tried to use the exact configuration as in this CodeShare: https://community.onespan.com/documentation/onespan-sign/codeshare/upload-document-through-multipartform-data-using-postman I'm assuming there is an issue with the JSON body but I can't figure it out.
I am using Postman to test my calls but still no luck. Can anyone help me figure out what is wrong?
Reply to: Receiving Error "Number of uploaded files does not match number of documents specified in package."
Thursday, June 11, 2020 at 02:15pmHi Lindsay,
Welcome to OneSpan Sign! Try to check your Postman setup against below screenshot:
A sample JSON payload could look like below:
{
"roles": [
{
"id": "Role1",
"signers": [
{
"email": "[email protected]",
"firstName": "1.firstname",
"lastName": "1.lastname",
"company": "OneSpan Sign"
}
]
},
{
"id": "Role2",
"signers": [
{
"email": "[email protected]",
"firstName": "2.firstname",
"lastName": "2.lastname",
"company": "OneSpan Sign"
}
]
}
],
"documents": [
{
"approvals": [
{
"role": "Role1",
"fields": [
{
"page": 0,
"top": 100,
"subtype": "FULLNAME",
"height": 50,
"left": 100,
"width": 200,
"type": "SIGNATURE"
}
]
},
{
"role": "Role2",
"fields": [
{
"page": 0,
"top": 300,
"subtype": "FULLNAME",
"height": 50,
"left": 100,
"width": 200,
"type": "SIGNATURE"
}
]
}
],
"name": "Test Document"
}
],
"name": "Example Package",
"type": "PACKAGE",
"language": "en",
"emailMessage": "",
"description": "New Package",
"autocomplete": true,
"status": "SENT"
}
Duo
Reply to: Hi Lindsay, Welcome to…
Thursday, June 11, 2020 at 03:17pmHi Duo,
After looking at your screenshots, I noticed the value 'file' was not getting entered as the key for the attachment:
After adding that, the call worked:
Thanks for taking a look and giving me a good screenshot to look at!
Lindsay
Reply to: Receiving Error "Number of uploaded files does not match number of documents specified in package."
Thursday, June 11, 2020 at 03:30pmGlad to hear that! Feel free to post if you have any further questions.
Duo