kartik_shivhare | Posts: 21

Unknown Error While creating package

0 votes
Hi , i am trying to create a package using the rest API with sandbox url : https://sandbox.esignlive.com/api/packages. I am getting an error response. {"technical":"","entity":null,"packageId":null,"messageKey":"http.status.400","messageLanguage":null,"message":"Validation Error","parameters":{},"code":400,"name":"Validation Error"} I am unable to get what exactly is the problem. Please reply soon. I have a query if payload json needs indentation. Sample requests are as : Sample 1 ------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="file"; filename="download.pdf" Content-Type: application/pdf filedata ------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="payload" { "documents":[ { "name":"Test package" } ] } ------WebKitFormBoundary1bNO60n7FqP5WO4t-- Sample 2 --WebKitFormBoundary9ee44645-3603-4c93-be15-e5858198b9f8 Content-Disposition: form-data; name="payload" { "type": "PACKAGE", "language": "en", "name": "Test package", "documents": [ { "approvals": [ { "role": "Customer", "name": "CustomerSignature", "id": "CustomerSignature", "fields": [ { "name": "APR", "id": "APR", "extract": true, "type": "INPUT", "subtype": "TEXTFIELD" }, { "name": "CustomerSignature", "id": "CustomerSignature", "extract": true, "type": "SIGNATURE", "subtype": "FULLNAME" } ] }, { "role": "Customer", "name": "Agent", "id": "Agent", "fields": [ { "name": "Agent", "id": "Agent", "extract": true, "type": "SIGNATURE", "subtype": "FULLNAME" } ] } ], "extract": true, "index": 0, "name": "Test Document1" } ], "roles": [ { "type": "SIGNER", "id": "Customer", "signers": [ { "signature": null, "firstName": "role", "lastName": "one", "email": "[email protected]", "id": "Customer" } ], "name": "Customer" } ] } ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="download.pdf" Content-Type: application/pdf filedata --WebKitFormBoundary9ee44645-3603-4c93-be15-e5858198b9f8--

Approved Answer
Duo_Liang | Posts: 3776

Reply to: Unknown Error While creating package

0 votes
Hi kartik, From your txt file, did you put extra two dashes in the front of your boundary? For example, your boundary has 8 dashes in the beginning, so all your separators should include 10 dashes in the beginning and the last line includes another two dashes in the end. Duo

Duo_Liang | Posts: 3776

Reply to: Unknown Error While creating package

0 votes
Hi kartik, If you are encountering 400 "Validation Error", it's most likely that your request construction is not valid. From your request samples, I guess it could because of the multipart_boundary you are using is not in consistent and the last line of the request should be like "--" + boundary + "--"(with two dashes instead of one) The attachment is a picture shows you the standard http request which you can check with your owns or you can kindly refer to my blog for more information. Hope this could help you! Duo

Attachments
9-10-1.png51.88 KB
kartik_shivhare | Posts: 21

Reply to: Unknown Error While creating package

0 votes
My Request has two dashes which have got ommitted in the submitted request . as per the sample provided in your rest api , package can be created with the basic request . Please find below my request . But i am still getting error . Please specify if we can create a package with this basic request or no. It is the editor in which you see my sample which is modifying the dashes . i am attaching the document Header POST https://sandbox.esignlive.com/api/packages Content-Type: multipart/form-data; boundary=--------WebKitFormBoundaryd80d6bd2cc5e4c2aaaeac1075d9d67b0 Accept: application/json Authorization: Basic MyApiKEY Body as follows --------WebKitFormBoundaryd80d6bd2cc5e4c2aaaeac1075d9d67b0 Content-Disposition: form-data; name="payload" { "name": "Test package" } --------WebKitFormBoundaryd80d6bd2cc5e4c2aaaeac1075d9d67b0--

kartik_shivhare | Posts: 21

Reply to: Unknown Error While creating package

1 votes
Please find below attached request.

kartik_shivhare | Posts: 21

Reply to: Unknown Error While creating package

0 votes
Text file is not supported , there is no upfront validation , hence , the file is not visible in the previous post. i am attaching the png file now.Please respond

Attachments
kartik_shivhare | Posts: 21

Reply to: Unknown Error While creating package

0 votes
My Recent request is as follows . I am not calling documets api , instead i am calling packages api Dashes are omitted by your editor . When i use the same input from an webpage , it is working but if i use it from C# library and call that library from an NUNit , i am getting the same issue.Please help me as i am stuck . I can email you the request if you want , i am stuck on this. POST : https://sandbox.esignlive.com/api/packages Content-Type: multipart/form-data; boundary=----WebKitFormBoundary88a792097f774b98a7cef06db25a2718 Accept: application/json Authorization: Basic ApiKey ----WebKitFormBoundary88a792097f774b98a7cef06db25a2718 Content-Disposition: form-data; name="payload" { "type": "PACKAGE", "language": "en", "name": "Test package", "documents": [ { "approvals": [ { "role": "Customer", "name": "CustomerSignature", "id": "CustomerSignature", "fields": [ { "name": "APR", "id": "APR", "extract": true, "type": "INPUT", "subtype": "TEXTFIELD" }, { "name": "CustomerSignature", "id": "CustomerSignature", "extract": true, "type": "SIGNATURE", "subtype": "FULLNAME" } ] }, { "role": "Customer", "name": "Agent", "id": "Agent", "fields": [ { "name": "Agent", "id": "Agent", "extract": true, "type": "SIGNATURE", "subtype": "FULLNAME" } ] } ], "extract": true, "index": 0, "name": "Test Document1" } ], "roles": [ { "type": "SIGNER", "id": "Customer", "signers": [ { "signature": null, "firstName": "role", "lastName": "one", "email": "[email protected]", "id": "Customer" } ], "name": "Customer" } ] } ----WebKitFormBoundary88a792097f774b98a7cef06db25a2718 Content-Disposition: form-data; name="file"; filename="download.pdf" Content-Type: application/pdf %PDF-1.3 1 0 obj > stream ÿØÿà ----WebKitFormBoundary88a792097f774b98a7cef06db25a2718--

kartik_shivhare | Posts: 21

Reply to: Unknown Error While creating package

0 votes
Hi Duo , I completely understand that , dashes in the beginning are consistent for all the boundary tags and there are only two dashes in the end.It the editor which is not showing it properly .Please help me . I

kartik_shivhare | Posts: 21

Reply to: Unknown Error While creating package

0 votes
Hi Duo , I have also attached another request as an image.

Duo_Liang | Posts: 3776

Reply to: Unknown Error While creating package

0 votes
Hi Kartik, Can you send your code to [email protected] so that I can have a closer look at that? 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