engg_nayan

Unable to insert document with an existing package

0 votes
Hi, I am unable to insert document with an existing package. My sandbox api key and url work fine. But my company api key and url show errors. My code: import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import com.silanis.esl.sdk.Document; import com.silanis.esl.sdk.DocumentPackage; import com.silanis.esl.sdk.DocumentType; import com.silanis.esl.sdk.EslClient; import com.silanis.esl.sdk.PackageId; import com.silanis.esl.sdk.builder.DocumentBuilder; public class DocumentUpload { public static void main(String[] args) throws FileNotFoundException { System.setProperty("javax.net.ssl.trustStore","C:/Users/pl29158/myprojects/meao/srv/config/wspcerts.jks"); InputStream documentInputStream1= new FileInputStream("C://Users/pl29158/doc/sample_file2.pdf"); Document document = DocumentBuilder.newDocumentWithName("Example Document") //.fromFile("C://Users/pl29158/doc/sample_file2.pdf") .fromStream( documentInputStream1, DocumentType.PDF ) .withId("docuvment1") .withDescription("Sample Document Description") .build(); EslClient eslClient = new EslClient(Utility.API_KEY,Utility.BASE_URL); DocumentPackage documentPackage = eslClient.getPackage(new PackageId("yDJEFQ60jEbNxB7AZ3L6yCBiOCU=")); eslClient.uploadDocument(document, documentPackage); } } errors: Exception in thread "main" com.silanis.esl.sdk.internal.EslServerException: Could not upload document to package. Exception: HTTP POST on URI https://e-signature-uat.pnc.com/a/api/packages/yDJEFQ60jEbNxB7AZ3L6yCBiOCU=/documents resulted in response with status code: [406, Not Acceptable]. Optional details: {"code":406,"entity":null,"message":"Not Acceptable","messageKey":"http.status.406","name":"Not Acceptable","technical":"","packageId":null,"messageLanguage":null} 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 esignLiv.com.DocumentUpload.main(DocumentUpload.java:30) Caused by: com.silanis.esl.sdk.internal.RequestException: HTTP POST on URI https://e-signature-uat.pnc.com/a/api/packages/yDJEFQ60jEbNxB7AZ3L6yCBiOCU=/documents resulted in response with status code: [406, Not Acceptable]. Optional details: {"code":406,"entity":null,"message":"Not Acceptable","messageKey":"http.status.406","name":"Not Acceptable","technical":"","packageId":null,"messageLanguage":null} 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) ... 4 more

Reply to: Unable to insert document with an existing package

0 votes
Hi there, Since this is an on-premise installation, you will need to contact our support team where we have a dedicated team for on-premise customers. Sorry for the inconvenience. [email protected]
Haris Haidary OneSpan Technical Consultant

Reply to: Unable to insert document with an existing package

0 votes
Thanks for quick reply.

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