How to set challenge question after all signatures are complete
Friday, April 8, 2022 at 01:14amHi,
Is there anyway to set the challenge question after all signatures are complete. The scenario i have is one the package is generated and signed we send an email out to the user with a link to download the signed copies those signed copies need to be protected with a challenge question.
Thanks.
Reply to: How to set challenge question after all signatures are complete
Monday, April 18, 2022 at 05:05pmHi Hassan,
Two things I noticed from your code:
(1)The direct cause of error is that your signer has a title, whereas it's not in the SignerBuilder:
private Signer AddSignerAuthentication(Signer signer, Authentication authentication) {
SignerBuilder signerWithChallengeBuilder = SignerBuilder.NewSignerWithEmail(signer.Email)
.WithFirstName(signer.FirstName)
.WithLastName(signer.LastName)
.WithCompany(signer.Company)
.WithTitle(signer.Title)
.WithLanguage(signer.Language)
.WithEmailMessage(signer.Message)
.WithCustomId(signer.Id)
.WithAuthentication(authentication);
if (signer.Attachments.Count > 0) {
foreach (var attachmentRequirement in signer.Attachments) {
signerWithChallengeBuilder.WithAttachmentRequirement(attachmentRequirement);
}
}
return signerWithChallengeBuilder.Build();
}
(2) If there are multiple signers required to be updated, you don't have to repeatedly Edit then SendPackage - it can be moved outside the loop
foreach (var signer in package.Signers)
{
......
if (signStatus == SigningStatus.SIGNING_COMPLETE)
{
......
eslClient.PackageService.Edit(packageId); //REVIEW_FOR_COMPLETION -> DRAFT
await Task.Run(() => eslClient.PackageService.UpdateSigner(packageId, signerWithChallenge));
eslClient.PackageService.SendPackage(packageId); //DRAFT -> REVIEW_FOR_COMPLETION
}
......
}
Duo
Duo Liang OneSpan Evangelism and Partner Integrations Developer
Reply to: How to set challenge question after all signatures are complete
Friday, April 8, 2022 at 09:37amHi Hassan,
Thanks for the clarification! If you happen to have a callback listener set up, you can utilize that and follow this approach:
(1)When creating the transaction, set "autoComplete" to false. Take .NET SDK code for example:
DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("Test Transaction")
.WithoutAutomaticCompletion()
......
(2)Instead of monitoring "PACKAGE_COMPLETE" event, your listener would monitor "PACKAGE_READY_FOR_COMPLETE" event in this case. This will keep the completion email on hold until you add challenge questions to your signer and programmatically complete the transaction. In .NET SDK code:
OssClient ossClient = new OssClient(apiKey, apiUrl);
PackageId packageId = new PackageId("kZ2HfmfK9mooKO4Xt_bcw0s9HDs=");
DocumentPackage reviewForCompletion = ossClient.GetPackage(packageId);
Signer signer = reviewForCompletion.GetSigner("[email protected]");
Signer signerWithChallenge = SignerBuilder.NewSignerWithEmail(signer.Email)
.WithFirstName(signer.FirstName)
.WithLastName(signer.LastName)
.WithCustomId(signer.Id)
......
.WithAuthentication(ChallengeBuilder.FirstQuestion("question").Answer("answer").Build())
.Build();
ossClient.PackageService.Edit(packageId); //REVIEW_FOR_COMPLETION -> DRAFT
ossClient.PackageService.UpdateSigner(packageId, signerWithChallenge);
ossClient.PackageService.SendPackage(packageId); //DRAFT -> REVIEW_FOR_COMPLETION
ossClient.PackageService.MarkComplete(packageId); //REVIEW_FOR_COMPLETION -> COMPLETED
Note, the code I skipped should cover all the signer level features you are leveraging, e.g. signer message, signer language, signer attachment, etc.
Duo
Duo Liang OneSpan Evangelism and Partner Integrations Developer
Reply to: How to set challenge question after all signatures are complete
Friday, April 8, 2022 at 02:40pmThanks i will try this out.
Reply to: How to set challenge question after all signatures are complete
Monday, April 11, 2022 at 01:37amHey i added the code above and now i am getting the following error:
Unable to edit package. Exception: The remote server returned an error: (400) Bad Request. HTTP PUT on URI https://sandbox.e-signlive.ca/api/packages/r3RfwzHQ_rhysQYBGLOcR1T5f78=. Optional details: {"messageKey":"error.validation.cannotChangePackageStatus","message":"Cannot change package status.","code":400,"name":"Validation Error"}
I read some documentation and it seems like package can only be edited in DRAFT status but we need to add challange question after all documents are signed.
Thanks.
Reply to: How to set challenge question after all signatures are complete
Monday, April 11, 2022 at 10:27amHey i added the code above and now i am getting the following error:
Unable to edit package. Exception: The remote server returned an error: (400) Bad Request. HTTP PUT on URI https://sandbox.e-signlive.ca/api/packages/r3RfwzHQ_rhysQYBGLOcR1T5f78=. Optional details: {"messageKey":"error.validation.cannotChangePackageStatus","message":"Cannot change package status.","code":400,"name":"Validation Error"}
I read some documentation and it seems like package can only be edited in DRAFT status but we need to add challange question after all documents are signed.
Thanks.
Reply to: How to set challenge question after all signatures are complete
Monday, April 11, 2022 at 10:35amHi Hassan,
Thanks for the information! Like I mentioned above, you need an additional step to set "autoComplete" to false in package creation step:
DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("Test Transaction")
.WithoutAutomaticCompletion()
......
This prevents the transaction from automatically get completed and provides the integration point where your callback integration can edit the transaction and signer.
Duo
Duo Liang OneSpan Evangelism and Partner Integrations Developer
Reply to: How to set challenge question after all signatures are complete
Monday, April 11, 2022 at 10:57amYa i did add that
var packageBuilder = PackageBuilder.NewPackageNamed(signingPackage.Name)
.WithoutAutomaticCompletion()
.WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings()
.WithHandOverLinkHref(signingPackage.HandOverLinkHref)
.WithHandOverLinkText(signingPackage.HandOverLinkText)
.WithoutOptOut()
.WithoutDocumentToolbarDownloadButton()
.HideOwnerInPersonDropDown()
.WithDecline()
.WithDeclineOther()
.WithMaxAuthAttempts(3)
.WithoutDialogOnComplete()
.WithoutCaptureText()
.WithoutLanguageDropDown()
.WithCeremonyLayoutSettings(CeremonyLayoutSettingsBuilder.NewCeremonyLayoutSettings()
.WithGlobalDownloadButton()
.WithLogoImageSource(signingPackage.LogoUrl)
//.WithoutTitle()
.WithoutSessionBar()
.WithoutGlobalNavigation()
.WithoutBreadCrumbs()))
.WithLanguage(Thread.CurrentThread.CurrentUICulture)
.WithAutomaticCompletion();
Reply to: How to set challenge question after all signatures are complete
Monday, April 11, 2022 at 11:24amAt the last line - .WithAutomaticCompletion() - this has conflict with WithoutAutomaticCompletion()
Duo
Duo Liang OneSpan Evangelism and Partner Integrations Developer
Reply to: How to set challenge question after all signatures are complete
Monday, April 18, 2022 at 09:49amCould this be done outside of the Call back action.
Reply to: How to set challenge question after all signatures are complete
Monday, April 18, 2022 at 03:41pmHi
I am using the following code after all signers sign all documents
var eslClient = new EslClient(_apiKey, _apiUrl);
var packageId = new PackageId(signingPackage.VendorId);
var package = eslClient.GetPackage(packageId);
DocumentPackage reviewForCompletion = eslClient.GetPackage(packageId);
foreach (var signer in package.Signers)
{
try
{
var signertest = reviewForCompletion.GetSigner(signer.Email);
var signStatus = eslClient.GetSigningStatus(packageId, signer.Id, null);
if (signStatus == SigningStatus.SIGNING_COMPLETE)
{
var signer11 = reviewForCompletion.GetSigner(signer.Email);
var signerWithChallenge = SignerBuilder.NewSignerWithEmail(signer.Email)
.WithFirstName(signer.FirstName)
.WithLastName(signer.LastName)
.WithCustomId(signer.Id)
.WithAuthentication(ChallengeBuilder.FirstQuestion("What's your favorite sport?").Answer("soccer").Build())
.Build();
eslClient.PackageService.Edit(packageId); //REVIEW_FOR_COMPLETION -> DRAFT
//eslClient.PackageService.UpdateSigner(packageId, signerWithChallenge);
await Task.Run(() => eslClient.PackageService.UpdateSigner(packageId, signerWithChallenge));
eslClient.PackageService.SendPackage(packageId); //DRAFT -> REVIEW_FOR_COMPLETION
}
}
catch (Exception ex)
{
throw;
}
}
when this code is executed await Task.Run(() => eslClient.PackageService.UpdateSigner(packageId, signerWithChallenge)); i am getting the following error in return
"Silanis.ESL.SDK.EslServerException: 'Could not update signer. Exception: The remote server returned an error: (400) Bad Request. HTTP PUT on URI https://sandbox.e-signlive.ca/api/packages/MDoRT_Dnn_Na0hXuwsOhKRAO5HA=/roles/bfc69e69-a0f2-4304-a7bb-1035b1fa2a21. Optional details: {"messageKey":"error.validation.cannotEditSignerAfterSigning","message":"Recipient information cannot be updated because the recipient has already begun signing.","code":400}'"
I also noticed the application on OneSpan went from InProgress to Draft status.
Thanks.
Reply to: How to set challenge question after all signatures are complete
Tuesday, April 19, 2022 at 01:41amThanks so much it worked.