How to retrieve signingUrl when signerId is email address while package creation
Thursday, February 20, 2020 at 11:53amHi,
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
Thursday, February 20, 2020 at 01:14pmHi 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
Reply to: Hi Neha, As you observed…
Thursday, February 20, 2020 at 02:36pmHi 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
Thursday, February 20, 2020 at 02:49pmHi 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