Simple Create And Send Package: Could not upload document to package Exception
Wednesday, May 25, 2016 at 04:23amHi all. Help with the following really appreciated.
Below code produces exception: "code":500,"name":"Unhandled Server Error". This exception occurs when uploading PDF with form inputs. Flat PDF (no form inputs) works fine. PDF form attached.
Working through tutorial at https://www.esignlive.com/blog/e-signlive-for-new-users-how-to-create-and-send-your-first-package-java-sdk/
package com.eightbitplatoon.esl.demo;
import static com.silanis.esl.sdk.builder.DocumentBuilder.newDocumentWithName;
import static com.silanis.esl.sdk.builder.PackageBuilder.newPackageNamed;
import static com.silanis.esl.sdk.builder.SignatureBuilder.signatureFor;
import static com.silanis.esl.sdk.builder.SignerBuilder.newSignerWithEmail;
import com.silanis.esl.sdk.DocumentPackage;
import com.silanis.esl.sdk.EslClient;
import com.silanis.esl.sdk.PackageId;
public class SimpleCreateAndSendPackage {
public static final String API_KEY = "xxxxx==";
public static final String API_URL = "https://sandbox.esignlive.com/api";
public static void main(String[] args) {
EslClient eslClient = new EslClient(API_KEY, API_URL);
// Build the DocumentPackage object
DocumentPackage documentPackage = newPackageNamed("ESL Demo Package API")
.withSigner(newSignerWithEmail("[email protected]").withCustomId("david").withFirstName("David")
.withLastName("Jones"))
.withSigner(newSignerWithEmail("[email protected]").withFirstName("James").withLastName("Jackson"))
.withDocument(newDocumentWithName("eSignDemo").fromFile("eSignDemo.pdf")
.withSignature(signatureFor("[email protected]").onPage(0).atPosition(175, 165))
.withSignature(signatureFor("[email protected]").onPage(0).atPosition(550, 165)))
.build();
// Issue the request to the e-SignLive server to create the
// DocumentPackage
PackageId packageId = eslClient.createPackage(documentPackage);
// Send the package to be signed by the participants
eslClient.sendPackage(packageId);
}
}
Exception in thread "main" com.silanis.esl.sdk.internal.EslServerException: Could not upload document to package. Exception: HTTP POST on URI https://sandbox.esignlive.com/api/packages/GHINncVG9A9ciK5WMGOBXyfp7JU=/documents resulted in response with status code: [500, Internal Server Error]. Optional details: {"messageKey":"error.internal.default","technical":"error.eslx.inputValidation.documentPreverifyError [#84f08b39-aca6-4bdf-97d3-421078ddd66b]","message":"Unexpected Error. Our technical staff have been notified and will look into the problem. We apologize for any inconvenience this may have caused you.","code":500,"name":"Unhandled Server Error"}
at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:255)
at com.silanis.esl.sdk.service.PackageService.uploadDocument(PackageService.java:240)
at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:556)
at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:560)
at com.silanis.esl.sdk.EslClient.createPackage(EslClient.java:235)
at com.eightbitplatoon.esl.demo.SimpleCreateAndSendPackage.main(SimpleCreateAndSendPackage.java:31)
Caused by: com.silanis.esl.sdk.internal.RequestException: HTTP POST on URI https://sandbox.esignlive.com/api/packages/GHINncVG9A9ciK5WMGOBXyfp7JU=/documents resulted in response with status code: [500, Internal Server Error]. Optional details: {"messageKey":"error.internal.default","technical":"error.eslx.inputValidation.documentPreverifyError [#84f08b39-aca6-4bdf-97d3-421078ddd66b]","message":"Unexpected Error. Our technical staff have been notified and will look into the problem. We apologize for any inconvenience this may have caused you.","code":500,"name":"Unhandled Server Error"}
at com.silanis.esl.sdk.internal.RestClient.execute(RestClient.java:195)
at com.silanis.esl.sdk.internal.RestClient.postMultipartFile(RestClient.java:132)
at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:251)
... 5 more
Reply to: Simple Create And Send Package: Could not upload document to package Exception
Wednesday, May 25, 2016 at 06:16amReply to: Simple Create And Send Package: Could not upload document to package Exception
Wednesday, May 25, 2016 at 02:13pm