Jayanta

Completing signing ceremony using SDK Programatically

0 votes
Hi Experts, We have a use case where in client doesn't want to use the UI for signing. Once an approval step is completed in the BPM, it needs to complete signing without the user having to go to eSignLive. We need : 1. Sample code for programmatically completing signing. 2. To know if it is possible to suppress sending out of the email to the end user. Thank you all in advance Thanks Jay

Approved Answer

Reply to: Completing signing ceremony using SDK Programatically

0 votes
Jay, This simple code worked for me:
PackageId packageId = new PackageId("ZkcTES9qoOQTLL5Q3BiAetjVoK0=");
		
eslClient.signDocuments(packageId, "Signer1");
Make sure you are using the account owner api key.
Haris Haidary OneSpan Technical Consultant

Reply to: Completing signing ceremony using SDK Programatically

0 votes
I tried out the following code and I got an exception.
PackageId packageId= eslClient.getPackage(new PackageId("nnnnnnnnnnnn")).getId();
		String signerId = eslClient.getPackage(packageId).getSigner("[email protected]").getId();
		eslClient.signDocuments(packageId, signerId);
I got the following exception

com.silanis.esl.sdk.internal.EslServerException: Could not create a signer authentication token. Exception: HTTP POST on URI https://signer-sandbox-gov.esignlive.com/authenticationTokens/signer/multiUse resulted in response with status code: [404, Not Found]. Optional details: {"code":404,"messageKey":"error.routeNotFound","technical":"This route does not exist.","packageId":null,"entity":null,"message":"The requested resource does not exist on this server.","name":"Resource Not Found"} at com.silanis.esl.sdk.service.apiclient.AuthenticationTokensApiClient.createSignerAuthenticationToken(AuthenticationTokensApiClient.java:72) at com.silanis.esl.sdk.service.AuthenticationTokensService.createSignerAuthenticationToken(AuthenticationTokensService.java:70) at com.silanis.esl.sdk.EslClient.signDocuments(EslClient.java:381) at esLConnect.main(esLConnect.java:24) Caused by: com.silanis.esl.sdk.internal.RequestException: HTTP POST on URI https://signer-sandbox-gov.esignlive.com/authenticationTokens/signer/multiUse resulted in response with status code: [404, Not Found]. Optional details: {"code":404,"messageKey":"error.routeNotFound","technical":"This route does not exist.","packageId":null,"entity":null,"message":"The requested resource does not exist on this server.","name":"Resource Not Found"} at com.silanis.esl.sdk.internal.RestClient.execute(RestClient.java:192) at com.silanis.esl.sdk.internal.RestClient.post(RestClient.java:105) at com.silanis.esl.sdk.service.apiclient.AuthenticationTokensApiClient.createSignerAuthenticationToken(AuthenticationTokensApiClient.java:69) ... 3 more


Reply to: Completing signing ceremony using SDK Programatically

0 votes
Hi Jay, That feature is not yet available in your current version of esignlive. You will be able to sign programmatically once version 11 has been pushed to the FedRamp instance.
Haris Haidary OneSpan Technical Consultant

Reply to: Completing signing ceremony using SDK Programatically

0 votes
Hi Harish, Thanks for your response.. The following code is exactly what we need. Any idea, why I am getting an error?
PackageId packageId= eslClient.getPackage(new PackageId("nnnnnnnnnnnn")).getId();
		String signerId = eslClient.getPackage(packageId).getSigner("[email protected]").getId();
		eslClient.signDocuments(packageId, signerId);

Reply to: Completing signing ceremony using SDK Programatically

0 votes
You're getting the error because the signDocuments() is not implemented in the application version you currently have. It will be available once FedRamp has been upgraded to version 11.
Haris Haidary OneSpan Technical Consultant

Reply to: Completing signing ceremony using SDK Programatically

0 votes
Hi Harish, But Right now I am posting to https://sandbox.esignlive.com, and still I get the same error. https://sandbox.esignlive.com is the right URL, for version 11? Thanks

Reply to: Completing signing ceremony using SDK Programatically

0 votes
Can you post the error when trying on sandbox.esignlive.com? You shouldn't be getting the same error.
Haris Haidary OneSpan Technical Consultant

Reply to: Completing signing ceremony using SDK Programatically

0 votes
com.silanis.esl.sdk.internal.EslServerException: Could not create a signer authentication token. Exception: HTTP POST on URI https://sandbox.esignlive.com/authenticationTokens/signer/multiUse resulted in response with status code: [401, Unauthorized]. Optional details: {"messageKey":"error.unauthorised.noSession","message":"Could not determine session user for request.","code":401,"name":"Unauthorized Access"} at com.silanis.esl.sdk.service.apiclient.AuthenticationTokensApiClient.createSignerAuthenticationToken(AuthenticationTokensApiClient.java:72) at com.silanis.esl.sdk.service.AuthenticationTokensService.createSignerAuthenticationToken(AuthenticationTokensService.java:70) at com.silanis.esl.sdk.EslClient.signDocuments(EslClient.java:387) at esLConnect.main(esLConnect.java:58) Caused by: com.silanis.esl.sdk.internal.RequestException: HTTP POST on URI https://sandbox.esignlive.com/authenticationTokens/signer/multiUse resulted in response with status code: [401, Unauthorized]. Optional details: {"messageKey":"error.unauthorised.noSession","message":"Could not determine session user for request.","code":401,"name":"Unauthorized Access"} at com.silanis.esl.sdk.internal.RestClient.execute(RestClient.java:192) at com.silanis.esl.sdk.internal.RestClient.post(RestClient.java:105) at com.silanis.esl.sdk.service.apiclient.AuthenticationTokensApiClient.createSignerAuthenticationToken(AuthenticationTokensApiClient.java:69) ... 3 more

Reply to: Completing signing ceremony using SDK Programatically

0 votes
Can you share a package id for which this error is happening? Thanks
Haris Haidary OneSpan Technical Consultant

Reply to: Completing signing ceremony using SDK Programatically

0 votes
PackageID: ZkcTES9qoOQTLL5Q3BiAetjVoK0=

Reply to: Completing signing ceremony using SDK Programatically

0 votes
Thank you!

Reply to: Completing signing ceremony using SDK Programatically

0 votes
Hi Haris, Thanks for your inputs today. Just a follow-up question: Do we need the Sender's API key to sign as the Sender or we can use Account Owner's API key to sign thanks Neel

Reply to: Completing signing ceremony using SDK Programatically

0 votes
You can use both.
Haris Haidary OneSpan Technical Consultant

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