Using Template, How to Replace Placeholder Signers
Monday, July 3, 2023 at 11:42amI am having trouble replacing the "Placeholder" signers for the template created. I have 2 signers setup as placeholders ('Signer1').
//Build actual Role in replacement of placeholder
String placeholder1Id = 'Signer1';
OneSpanAPIObjects.Role role1 = new OneSpanAPIObjects.Role();
OneSpanAPIObjects.Signer signer1 = new OneSpanAPIObjects.Signer();
signer1.firstName = sign1_first;
signer1.lastName = sign1_last;
signer1.email = sign1_email;
signer1.id = placeholder1Id;
//use role id to match placeholder
role1.signers = new List<OneSpanAPIObjects.Signer>{signer1};
role1.id = placeholder1Id;
pkg.roles = new List<OneSpanAPIObjects.Role>{role1};
pkg.status = OneSpanAPIObjects.PackageStatus.DRAFT;
pkg = sdk.helper.createPackageFromTemplate(pkg, 'xxxxxxxxxxxxxxxxxxxxxxxx=');
The transaction is being created just fine but the sign1 information is being added to the bottom of the signer's list and the placeholders
Reply to: Using Template, How to Replace Placeholder Signers
Monday, July 3, 2023 at 11:48amHi Brian,
Can I have the template ID? Because if you've created the template from UI, the placeholder's ID is probably not Signer1 (the UI label refers to the role name instead of ID).
Duo
Reply to: Using Template, How to Replace Placeholder Signers
Monday, July 3, 2023 at 11:53amI'm sure that's the case. Do I need to get the placeholder id's first, then replace?
Template ID = jRwMThEo6E25qkTcTG-QgKBfijM=
Reply to: Using Template, How to Replace Placeholder Signers
Monday, July 3, 2023 at 11:57amHi Brian,
Try to use below two placeholder IDs:
Signer1: rd5337RVVo4V
Signer2: A4ulZ6R9FVIV
Let me know if it doesn't resolve the issue.
Duo
Reply to: Using Template, How to Replace Placeholder Signers
Monday, July 3, 2023 at 11:58amFor future reference, how do I get these id's?
Reply to: Using Template, How to Replace Placeholder Signers
Monday, July 3, 2023 at 12:28pmHi Brian,
You can get the actual placeholder IDs by querying this API:
GET /api/packages/{template_id}
It's under "roles" > "id".
Duo