nsutaria

How to retrieve signingUrl when signerId is email address while package creation

0 votes

Hi,

I would like to understand how do we retrieve signingUrl when we pass signerId as an email address. I am using below snippet 

eslClient.getPackageService().getSigningUrl(transactionId, userIdentifier);

here I've userIdentifier is e.g.  "[email protected]"

when I traced through I found getSigningUrl() is calling getRole() private method instead of getRoleByEmail() private method. and  I am getting below error for retrieving signingUrl

2020-02-20 12:48:39.522 ERROR [-,5e4eaf2ce9ec017b2bd1e6fc3e7a191f,2bd1e6fc3e7a191f,false] 28272 --- [nio-8080-exec-2] com.silanis.esl.api.util.JacksonUtil     : Failed to deserialize json string: Error 404: Not Found
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Error': was expecting ('true', 'false' or 'null')

Thanks,

Neha

 

 

 


Reply to: How to retrieve signingUrl when signerId is email address while package creation

0 votes

Hi Neha,

 

As you observed, the getSigningUrl() function expects a signer ID instead of the email.

The get signing url API actually requires the role ID, but if you've set the .customId() for the signer which will set the signer ID the same as the role ID, you can use below code to achieve your goal:
 

 

String packageId = "your_package_id";

DocumentPackage pkg = eslClient.getPackage(new PackageId(packageId));

Signer signer = pkg.getSigner("signer_email");

String signingUrl = eslClient.getPackageService().getSigningUrl(pkg.getId(), signer.getId());

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to:

0 votes

Hi Duo,

Thanks for quick reply. one questions in your code suggestion 

String signingUrl = eslClient.getPackageService().getSigningUrl(pkg.getId(), signer.getId());      here what value would use as a signer.getId() from signer_email?

will it take entire email address or will it split from @ 

I want to keep as a unique identifier there.

Appreciate your help.

 

Thanks,

Neha

 


Reply to: How to retrieve signingUrl when signerId is email address while package creation

0 votes

Hi Neha,

 

Below is a typical Java SDK code creating a package:
 

        DocumentPackage updatedPkg = newPackageNamed("Test Package")
                .withSigner(newSignerWithEmail("[email protected]")
                        .withCustomId("Signer1")
                        .withFirstName("John")
                        .withLastName("Smith"))
                .withDocument(newDocumentWithName("sampleAgreementpdf.pdf")
                        .withId("document1")
                        .fromFile("./sources/Test PDF.pdf")
                        .withSignature(acceptanceFor("[email protected]"))
                        )
                .build();

 

So if you have specified the .withCustomId() value, this value will be set both as the signer ID and the role ID. This is also the value prompted for the .getSigningUrl() function. By default, if you didn't specify the signer/role ID, OneSpan Sign won't take the username part of the email. Instead, OneSpan Sign will generate two nonidentical random IDs for you. That's why I asked whether you have setup the custom ID.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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