Mikeadams | Posts: 1

Error - Number of uploaded files does not match number of documents specified in

0 votes
HI everyone during my integration I got stuck with this error> I wanted to create a package upload a file and add signatories.
{
  "messageKey": "error.validation.package.wrongNumberOfFiles",
  "technical": "Number of uploaded files does not match number of documents specified in package.",
  "message": "Number of uploaded files does not match number of documents specified in package.",
  "code": 400,
  "name": "Validation Error"
}
Here is the JSON payload I was using
{
  "roles ": [
    {
      "locked ": false,
      "emailMessage ": {
        "content ": " "
      },
      "attachmentRequirements ": [

      ],
      "reassign ": false,
      "specialTypes ": [

      ],
      "id ": "Sender ",
      "data ": null,
      "type ": "SIGNER ",
      "index ": 0,
      "signers ": [
        {
          "auth ": {
            "challenges ": [

            ],
            "scheme ": "NONE "
          },
          "company ": "IBM ",
          "firstName ": "Leon ",
          "lastName ": "Dong ",
          "phone ": " ",
          "email ": "[email protected] ",
          "knowledgeBasedAuthentication ": null,
          "language ": "en ",
          "title ": "IBM ",
          "external ": null,
          "professionalIdentityFields ": [

          ],
          "userCustomFields ": [

          ],
          "delivery ": {
            "email ": true,
            "provider ": false,
            "download ": true
          },
          "group ": null,
          "signature ": null,
          "address ": null,
          "data ": null,
          "name ": " ",
          "specialTypes ": [

          ]
        }
      ],
      "name ": "Sender "
    },
    {
      "locked ": false,
      "emailMessage ": {
        "content ": " "
      },
      "attachmentRequirements ": [

      ],
      "reassign ": false,
      "specialTypes ": [

      ],
      "id ": "Signer ",
      "data ": null,
      "type ": "SIGNER ",
      "index ": 0,
      "signers ": [
        {
          "auth ": {
            "challenges ": [

            ],
            "scheme ": "NONE "
          },
          "company ": " ",
          "firstName ": "Will ",
          "lastName ": "Smith ",
          "phone ": " ",
          "email ": "[email protected] ",
          "knowledgeBasedAuthentication ": null,
          "language ": "en ",
          "title ": " ",
          "external ": null,
          "professionalIdentityFields ": [

          ],
          "userCustomFields ": [

          ],
          "delivery ": {
            "email ": false,
            "provider ": false,
            "download ": false
          },
          "group ": null,
          "id ": "Signer ",
          "signature ": null,
          "address ": null,
          "data ": null,
          "name ": " ",
          "specialTypes ": [

          ]
        }
      ],
      "name ": "Signer "
    }
  ],
  "documents ": [
    {
      "approvals ": [
        {
          "role ": "Signer ",
          "signed ": null,
          "accepted ": null,
          "data ": null,
          "fields ": [
            {
              "page ": 0,
              "subtype ": "FULLNAME ",
              "width ": 200,
              "binding ": null,
              "extract ": false,
              "extractAnchor ": null,
              "left ": 175,
              "top ": 165,
              "validation ": null,
              "height ": 50,
              "data ": null,
              "type ": "SIGNATURE ",
              "value ": " "
            }
          ],
          "name ": " "
        },
        {
          "role ": "Sender ",
          "signed ": null,
          "accepted ": null,
          "data ": null,
          "fields ": [
            {
              "page ": 0,
              "subtype ": "FULLNAME ",
              "width ": 200,
              "binding ": null,
              "extract ": false,
              "extractAnchor ": null,
              "left ": 550,
              "top ": 165,
              "validation ": null,
              "height ": 50,
              "data ": null,
              "type ": "SIGNATURE ",
              "value ": " "
            }
          ],
          "name ": " "
        }
      ],
      "name ": "eSign Agreement "
    }
  ],
  "name ": "eSignature Test ",
  "type ": "PACKAGE ",
  "language ": "en ",
  "emailMessage ": " ",
  "description ": "New Package ",
  "autoComplete ": true,
  "status ": "SENT "
}
Any help is highly appreciated. Thanks.

mwilliams | Posts: 957

Reply to: Error - Number of uploaded files does not match number of documents specified in

0 votes
Did you include the file binaries and this JSON payload in a multipart/form-data payload? Similar to in this C# example: https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-rest/#csharp Also, this question is posted in the .NET SDK forum? Are you going to be using the .NET SDK or REST? I see in the post tags, you're using postman. You might also take a look at this tutorial: https://developer.esignlive.com/code-share/upload-document-multipartform-data-using-postman/

kpulivarthi | Posts: 1

Reply to: Error - Number of uploaded files does not match number of documents specified in

0 votes

{

    "messageKey": "error.validation.documentPreVerifyInvalidResponseNumberError",

    "code": 400,

    "parameters": {

        "errorException": "number of documents that need verification = 2, number of verification results = 0"

    },

    "message": "The number of Pre-Verify results does not match the number of documents that were sent for verification.",

    "name": "Validation Error"

}

json:

{
  "type": "PACKAGE",
  "status": "SENT",
  "roles": [
    {
      "id": "Signer1",
      "type": "SIGNER",
      "signers": [
        {
          "email": "[email protected]",
          "firstName": "SIGNER_FIRST_NAME",
          "lastName": "SIGNER_LAST_NAME",
          "id": "Signer1"
        }
      ]
    }
  ],
  "name": "Package -v1",
  "documents": [
    {  
      "extract": true,
      "name": "Sample Agreement",
      "id": "poc-agreement-one",
      "data": {
        "esl_doc_extract_type": 1
      }
    }
  ]
}

I got above error, Can you tell me what we need to or anything missing from my side?


Duo_Liang | Posts: 3776

Reply to:

0 votes

Hi kpulivarthi,

 

I did a quick test with the JSON you provided and a PDF containing text tags, and the JSON looks good to me. Hence I think it could be related to the uploaded document.

Which environment are you developing with? US2 sandbox (https://sandbox.esignlive.com) vs CA sandbox (https://sandbox.e-signlive.ca), etc? Is it possible that you shared the uploaded document (without personal information) to [email protected] so that I can look closer at the issue?

 

Duo


csar | Posts: 4

Reply to: Error - Number of uploaded files does not match number of documents specified in

0 votes

 

A question, I want to test this request against my sandbox in this way., I am recovering the document from an aws s3 and I send it doing an equivalent in php it works but from where I need it which is in node, it does not work that I can have it wrong.

 

JSON: {"name":"TiendaSeguros_747597225081986_106","description":"TiendaSeguros_747597225081986_58","emailMessage":"TiendaSeguros_747597225081986_58","autocomplete":true,"type":"PACKAGE","visibility":"ACCOUNT","due":null,"language":"es","status":"SENT","documents":[{"fields":[{"value":"58","name":"poliza"},{"value":"Antecedentes Personales","name":"ramo"},{"value":"08","name":"dia"},{"value":"04","name":"mes"},{"value":"2021","name":"anio"},{"value":"C\u00e9sar Bianco","name":"nombresSignerTop"},{"value":"C\u00e9sar Bianco","name":"nombresSignerBottom"},{"value":"C.E.","name":"td"},{"value":"747597225081986","name":"documento"},{"value":"1","name":"NroCuenta"},{"value":"Banco Davivienda","name":"entidadBancaria"},{"value":"Ahorro","name":"tipoCuenta"}],"extract":true,"extractionTypes":["TEXT_TAGS"],"name":"Firma Cliente"}],"roles":[{"id":"Signer1","index":0,"type":"SIGNER","data":null,"reassign":false,"deliverDocumentsByEmail":false,"emailMessage":{"content":"ACCIDENTES PERSONALES"},"attachmentRequirements":[],"specialTypes":[],"locked":false,"signers":[{"address":null,"company":"","timezoneId":"","created":"2021-04-09T17:49:34Z","email":"[email protected]","firstName":"C\u00e9sar","lastName":"Bianco","id":"Signer1","external":null,"language":"es","phone":"","professionalIdentityFields":[],"signature":null,"title":"","updated":"2021-04-09T17:49:34Z","userCustomFields":[],"specialTypes":[],"passwordTimestamp":null,"group":null,"data":null,"auth":{"scheme":"NONE"},"knowledgeBasedAuthentication":null,"delivery":{"provider":false,"download":false,"email":false},"signerType":"EXTERNAL_SENDER","ssoConfigured":false,"name":""}],"name":"Signer1"}]}

 

Request: 

 

var options = {

method: 'post',

url: "https://sandbox.esignlive.com/api/packages",

headers: {

"Authorization": "Bearer 178ff11db550a5a712d58cf0817598",

"Accept": "application/json;",

"Accept-Encoding":"gzip, deflate, br",

"Content-Type": "multipart/form-data; boundary=\"----WebKitFormBoundary7MA4YWxkTrZu0gW\"",

},

formData: {

payload: json,

file: {

value: document,

options: { filename: 'FirmaClienteSaludConDebito.pdf', contentType: null }

}

}

};

let requestOneSpan = request.post(options, function(error, response, body) {

console.log("--------------------------------------------------------------------")

console.log(body);

});

 

if I change the reading of the file and read it from my local, if it works

 

ERROR: 

 

--------------------------------------------------------------------
{"messageKey":"error.validation.documentPreVerifyInvalidResponseNumberError","parameters":{"errorException":"number of documents that need verification = 2, number of verification results = 0"},"message":"The number of Pre-Verify results does not match the number of documents that were sent for verification.","code":400,"name":"Validation Error"}
 

 


Duo_Liang | Posts: 3776

Reply to:

0 votes

Hi csar,

 

Could you either capture the outbound raw request body, or print the variable "document" to the console? If I understand you correctly, essentially you meant it worked when the "document" was read from a local PDF, but didn't work when reading it from aws s3? I think the error message you received from OneSpan Sign API also confirmed that - the actual uploaded documents don't match the expected number.

 

Duo


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off