Signer Role
Monday, April 19, 2021 at 12:13pmI am looking for a place to store a signer's role. The idea here is we can store an attribute against a signer that allows us to find the proper signer based on some role in our workflow. I tried to use 'signerType' - but it seems the system wants to store its own values there such as EXTERNAL_SIGNER etc.
For now I plan to store my role property in Signer 'placeHolderName' but I am not sure what this attribute is supposed to hold.So 3 questions:
What is 'placeHolder' supposed to be?
Is it possible to store custom attributes against a signer? I know about customId but we are already using that.
Is it possible to request a new 'signerRole' attribute for Signers?
Thanks
Reply to: Signer Role
Monday, April 19, 2021 at 12:51pmHi Michael,
Try to store custom data at "roles" > "data", like below example:
{
"roles": [
{
"id": "Role1",
"data": {
"data1": "value1",
"data2": "value2"
},
"signers": [
{
"email": "[email protected]",
"firstName": "1.firstname",
"lastName": "1.lastname",
"company": "OneSpan Sign"
}
]
}
],
"documents": [
{
"approvals": [
{
"role": "Role1",
"fields": [
{
"page": 0,
"top": 300,
"subtype": "FULLNAME",
"height": 50,
"left": 100,
"width": 200,
"type": "SIGNATURE"
}
]
}
],
"name": "Test Document"
}
],
"name": "Example Package",
"type": "PACKAGE",
"language": "en",
"emailMessage": "",
"description": "New Package",
"autocomplete": true,
"status": "SENT"
}
Duo
Duo Liang OneSpan Evangelism and Partner Integrations Developer
Reply to: Hi Michael, Try to store…
Monday, April 19, 2021 at 03:27pmWell this is confusing - at least to me. PackageService has an 'addRole' method to add a role to a DocumentPackage, but DocumentPackage does not appear to have any methods regarding roles. SignerBuilder withRoleId is deprecated. SignatureBuilder has a captureFor(Placeholder roleId) - not clear what that is. Is there any documentation of Java examples (SDK) that I can look at to see how it all fits together? What I would really like to do is tag a Signer with a role. For now I am hiding it in the title attribute, but I know this is not right.
Reply to: Signer Role
Monday, April 19, 2021 at 03:40pmOkay, since you are developing with Java SDK, as I stated above, in API modelling you can choose to host data at "roles" > "data", however this is not included in the SDK modelling. (SignerBuilder class doesn't have this member field, placeholderName is ONLY applicable when you are creating placeholder signers)
As a workaround, you can store custom data at package level or document level, try code like this:
DocumentPackage superDuperPackage = PackageBuilder.newPackageNamed("Policy " + new SimpleDateFormat("HH:mm:ss").format(new Date()))
......
.withAttributes(DocumentPackageAttributesBuilder.newDocumentPackageAttributes()
.withAttribute( "First Name", "Bill" )
.withAttribute("Last Name", "Johnson")
.withAttribute("Signing Order", "1"))
.build();
Duo
Duo Liang OneSpan Evangelism and Partner Integrations Developer
Reply to: Signer Role
Wednesday, April 21, 2021 at 01:24pmReply to: Sorry if this is a dual post…
Wednesday, April 21, 2021 at 01:52pmIn order to achieve your goal, you need below 4 steps (assuming the Signer's custom ID is "Signer1" and you have a package data attribute "Signer1" : "some reference ID"):
//step1: change package status to draft
eslClient.changePackageStatusToDraft(packageId);
//step2: remove signer
eslClient.getPackageService().removeSigner(packageId, "Signer1");
//step3: update package attributes
DocumentPackage package1 = eslClient.getPackage(packageId);
Map<String, Object> contents = package1.getAttributes().getContents();
contents.remove("Signer1");
eslClient.getPackageService().updatePackage(packageId, package1);
//step4: send package
eslClient.sendPackage(packageId);
Back to your specific questions:
#1 You need to call the updatePackage function to make the update take effect
#2 The 403 error you are receiving seems to indicate that the API Key/Token holder doesn't have sufficient permission to modify the package. Is it the same EslClient object you used to changePackageStatusToDraft() then sendPackage()?
Duo
Duo Liang OneSpan Evangelism and Partner Integrations Developer