nvv

Error Code 400 - Validation Error

0 votes
Hi, I'm trying to follow the example https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-rest/ however there seems to be conflicting information between the required fields listed there and the ones listed on the YAML. Looking for some help in troubleshooting the bad response i'm getting. Please find attached my payload (redacted the PDF data and personal info). The PDF is being attached as a BASE64 encoded file, if that helps to debug. For example, starts with JVBERi0xLjQKJeLjz9MKMyAwIG9iaiA8P The server returned status code: 400 Message: Bad Request Response: { "entity": null, "technical": "", "packageId": null, "messageKey": "http.status.400", "messageLanguage": null, "parameters": {}, "message": "Validation Error", "code": 400, "name": "Validation Error" } URL USED: https://sandbox.esignlive.com/api/packages QUERYSTRING USED: null PAYLOAD USED: --SilanisBoundary31353632393532313830323931 Content-Disposition: form-data; name="file"; filename="f_1562952145867.pdf" Content-Type: application/pdf Content-Transfer-Encoding: application/pdf **JVBERi0xLjQKJeLjz9MKMyAwIG9iaiA8P....REDACTED PDF DATA** --SilanisBoundary31353632393532313830323931 Content-Disposition: form-data; name="payload" { "description": "New Package", "documents": [ { "approvals": [ { "fields": [ { "extractAnchor": { "anchorPoint": "BOTTOMRIGHT", "characterIndex": 0, "height": 150, "index": 0, "leftOffset": 0, "text": "1555615512268", "topOffset": 0, "width": 40 }, "height": 0, "left": 0, "page": 0, "subtype": "FULLNAME", "top": 0, "type": "SIGNATURE", "width": 0 } ], "role": "1555615512268" }, { "fields": [ { "extractAnchor": { "anchorPoint": "BOTTOMRIGHT", "characterIndex": 0, "height": 150, "index": 0, "leftOffset": 0, "text": "1555615513009", "topOffset": 0, "width": 40 }, "height": 0, "left": 0, "page": 0, "subtype": "FULLNAME", "top": 0, "type": "SIGNATURE", "width": 0 } ], "role": "1555615513009" } ], "name": "1555615512117" } ], "emailmessage": "", "language": "en", "name": "Example Package", "roles": [ { "id": "1555615512268", "signers": [ { "company": null, "email": "**REDACTED**", "firstName": "Lazarus", "lastName": "Bishop" } ] }, { "id": "1555615513009", "signers": [ { "company": null, "email": "**REDACTED**", "firstName": null, "lastName": null } ] } ], "status": "SENT", "type": "PACKAGE" } --SilanisBoundary31353632393532313830323931--

Approved Answer

Reply to: Error Code 400 - Validation Error

0 votes
Hi nvv, Just in case anyone else might also encounter this issue later on, that this "documentPreVerifyInvalidResponseNumberError" is caused by the encoding way of the binary data which can't be recognized by OSS system. And can be solved by few tweaks in the custom code. Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Error Code 400 - Validation Error

0 votes
Raw Payload data as its being posted to the API: --SilanisBoundary31353632393532383935393536 Content-Disposition: form-data; name="file"; filename="f_1562952145867.pdf" Content-Type: application/pdf Content-Transfer-Encoding: application/pdf JVBERi0xLjQKJeLjz...**REDACTED** --SilanisBoundary31353632393532383935393536 Content-Disposition: form-data; name="payload" {"description":"New Package","documents":[{"approvals":[{"fields":[{"extractAnchor":{"anchorPoint":"BOTTOMRIGHT","characterIndex":0,"height":150,"index":0,"leftOffset":0,"text":"1555615513892","topOffset":0,"width":40},"height":0,"left":0,"page":0,"subtype":"FULLNAME","top":0,"type":"SIGNATURE","width":0}],"role":"1555615513892"},{"fields":[{"extractAnchor":{"anchorPoint":"BOTTOMRIGHT","characterIndex":0,"height":150,"index":0,"leftOffset":0,"text":"1555615514633","topOffset":0,"width":40},"height":0,"left":0,"page":0,"subtype":"FULLNAME","top":0,"type":"SIGNATURE","width":0}],"role":"1555615514633"}],"name":"1555615513741"}],"emailmessage":"","language":"en","name":"Example Package","roles":[{"id":"1555615514633","signers":[{"company":null,"email":"**REDACTEDEMAIL**","firstName":null,"lastName":null}]},{"id":"1555615513892","signers":[{"company":null,"email":"**REDACTEDEMAIL**","firstName":"Lazarus","lastName":"Bishop"}]}],"status":"SENT","type":"PACKAGE"} --SilanisBoundary31353632393532383935393536--

Reply to: Error Code 400 - Validation Error

0 votes
Tried again with decoded PDF payload, still the same 400 error. PFA the new payload used. --SilanisBoundary31353632393533343637333238 Content-Disposition: form-data; name="file"; filename="f_1562952145867.pdf" Content-Type: application/pdf Content-Transfer-Encoding: application/pdf %PDF-1.4 %���� **REDACTED** %%EOF --SilanisBoundary31353632393533343637333238 Content-Disposition: form-data; name="payload" {"description":"New Package","documents":[{"approvals":[{"fields":[{"extractAnchor":{"anchorPoint":"BOTTOMRIGHT","characterIndex":0,"height":150,"index":0,"leftOffset":0,"text":"1555615524295","topOffset":0,"width":40},"height":0,"left":0,"page":0,"subtype":"FULLNAME","top":0,"type":"SIGNATURE","width":0}],"role":"1555615524295"},{"fields":[{"extractAnchor":{"anchorPoint":"BOTTOMRIGHT","characterIndex":0,"height":150,"index":0,"leftOffset":0,"text":"1555615525036","topOffset":0,"width":40},"height":0,"left":0,"page":0,"subtype":"FULLNAME","top":0,"type":"SIGNATURE","width":0}],"role":"1555615525036"}],"name":"1555615524144"}],"emailmessage":"","language":"en","name":"Example Package","roles":[{"id":"1555615525036","signers":[{"company":null,"email":"**","firstName":null,"lastName":null}]},{"id":"1555615524295","signers":[{"company":null,"email":"*","firstName":"Lazarus","lastName":"Bishop"}]}],"status":"SENT","type":"PACKAGE"} --SilanisBoundary31353632393533343637333238--

Reply to: Error Code 400 - Validation Error

1 votes
Hi nvv, First related to the PDF encoding way, please don't encode the PDF into base64 string as OneSpan Sign can only take pdf binaries. But it may not related to the 400 validation error because this error seems refer to the incorrect request structure. And did you add two dashes in the beginning for all separators and at the end for last line instead of one? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Error Code 400 - Validation Error

0 votes
Hi Duo, Thanks for the quick reply. I'm using two dashes in the beginning for all separators and at the end for last line. I think when I pasted the payload here it converted to one. I also have the document portion of the payload as suggested in your picture, with the one extra line in between, and all my lines are using CRLF I made some testing and changes to add an extra blank line under payload - Content:Disposition, it gave me some more detailed 400 errors and resolved them (such as null Company name,etc). but now I'm getting the following error, again with all BinaryData PDF rather than base64. Please find attached the payload from Postman --SilanisBoundary31353632393533343637333238 Content-Disposition: form-data; name="file"; filename="f_1562952145867.pdf" Content-Type: application/pdf %PDF-1.4 %���� 3 0 obj >stream x�+�*T0T0�B�����f������U���e�`ni�����E **REDACTED** 43747 %%EOF --SilanisBoundary31353632393533343637333238 Content-Disposition: form-data; name="payload" { "description": "New Package", "documents": [ { "approvals": [ { "fields": [ { "extractAnchor": { "anchorPoint": "BOTTOMRIGHT", "characterIndex": 0, "height": 150, "index": 0, "leftOffset": 0, "text": "1555615491838", "topOffset": 0, "width": 40 }, "height": 0, "left": 0, "page": 0, "subtype": "FULLNAME", "top": 0, "type": "SIGNATURE", "width": 0 } ], "role": "1555615491838" }, { "fields": [ { "extractAnchor": { "anchorPoint": "BOTTOMRIGHT", "characterIndex": 0, "height": 150, "index": 0, "leftOffset": 0, "text": "1555615492766", "topOffset": 0, "width": 40 }, "height": 0, "left": 0, "page": 0, "subtype": "FULLNAME", "top": 0, "type": "SIGNATURE", "width": 0 } ], "role": "1555615492766" } ], "name": "1555615491791" } ], "emailmessage": "", "language": "en", "name": "Example Package", "roles": [ { "id": "1555615492766", "signers": [ { "company": "Test", "email": "NVV", "firstName": "Lazarus", "lastName": "Lazarus" } ] }, { "id": "1555615491838", "signers": [ { "company": "Test", "email": "NVV", "firstName": "Lazarus", "lastName": "Bishop" } ] } ], "status": "SENT", "type": "PACKAGE" } --SilanisBoundary31353632393533343637333238-- 500 Internal Server Error Time:211 ms Size:616 B { "messageKey": "error.internal.default", "technical": "error.eslx.inputValidation.documentPreVerifyInvalidResponseNumberError [#03a28a49-6078-4033-9b0a-ed5748c3f181]", "message": "Unexpected error. We apologize for any inconvenience this may have caused you, please try again. If the problem persists, please contact our support team.", "code": 500, "name": "Unhandled Server Error" }

Reply to: Error Code 400 - Validation Error

0 votes
Can I have your testing PDF and the code using? You could send them to [email protected] Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Error Code 400 - Validation Error

0 votes
Thanks Duo for all your help. My issue was exactly that, the method by which the PDF was being uploaded. When I changed it to upload the binary bytes without any encoding, everything worked and i got my package id!

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