mailtodanish

how to add multiple AttachmentRequirementBuilder dynamically

0 votes
Hi, I have to ask Required Document from signer but Number of Required documnet is dynamic. It depends upon agent to ask any number of document to signer. I have created signer using SDK and want to add required doc dynamically based on number of documentes requested to Java code. Thanks

Approved Answer

Reply to: how to add multiple AttachmentRequirementBuilder dynamically

0 votes
If you want to update signer before signer get started to sign, you could below code snippet:
		EslClient eslClient = new EslClient(API_KEY, API_URL);
		
		PackageId packageId = new PackageId("kfVWhzcNLDIzAe0rfvJC91sd6VI=");
		DocumentPackage package1 = eslClient.getPackage(packageId);
		Signer signer = package1.getSigner("[email protected]");
		
		AttachmentRequirement attachment1 = AttachmentRequirementBuilder.newAttachmentRequirementWithName("attachment1")
								.withDescription("attachment1 description")
								.isRequiredAttachment()
								.build();
		
		AttachmentRequirement attachment2 = AttachmentRequirementBuilder.newAttachmentRequirementWithName("attachment2")
									.withDescription("attachment2 description")
									.isRequiredAttachment()
									.build();
		
		AttachmentRequirement attachment3 = AttachmentRequirementBuilder.newAttachmentRequirementWithName("attachment3")
									.withDescription("attachment3 description")
									.isRequiredAttachment()
									.build();
		
		signer.setAttachmentRequirements(Collections.EMPTY_LIST);
		eslClient.getPackageService().updateSigner(packageId, signer);
		signer.setAttachmentRequirements(Arrays.asList(attachment1,attachment2,attachment3));
		eslClient.getPackageService().updateSigner(packageId, signer);
If there's attachment(s) set for the signer, you'd update the signer twice, first to remove all existing ones, then upload dynamic number of attachments. Hope this could help! Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: how to add multiple AttachmentRequirementBuilder dynamically

0 votes
Hi there, I want to elicit more background information on your workflow. Are you doing remote signing or in-person signing? When and how would your agent specifies the number of required attachment? It's during or before the Signing Ceremony? 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