Using text tags without knowing exact signers of document
Wednesday, April 12, 2023 at 01:48pmHello,
We are using the .NET SDK to setup transactions with documents containing only signature fields. We are using Text Tag extraction as our signature locator and I attached the code we are using to do this.
This works great for all of our current use cases. Going forward, however, we will be sending documents where we will not be able to populate the document roles (as we do in that code snippet) with the correct signer roles involved. For example, we might have a transaction with (2) signers and a document which may or may not have a text tag for each of them (we are a middleman system here).
We tried a test case using the code you see where we sent in a single document with a valid text tag for signer "s1" but no text tag for "s2". We then set the document roles to contain both "s1" and "s2" (see code). However, this fails and results in OneSpan responding that there are no approvals for signer "s2" on the document. Repeating this test with a document which has text tags for both "s1" and "s2" shows that both signers are able to sign as expected.
My question: Is there some way we can instruct OneSpan to automatically map all signers to their respective text tags and to not error when a signer has no approval on a particular document?
Thanks!
For reference, I found these somewhat related posts which refer to the automatic nature of text tag extraction:
Reply to: Using text tags without knowing exact signers of document
Wednesday, April 12, 2023 at 03:51pmHi Ron,
It's always nice to hear from you! Yes, you are right that OneSpan Sign text tags have automatic nature and should be able to automatically map signers to their respective text tags. If you have API test tool by hand (like Postman) and try the transaction creation API with below JSON payload + your test documents, you should be able to create the transaction. (If s2 doesn't have any signature, he/she will become a reviewer. We can add an additional step to remove all recipients who doesn't have signatures after the creation)
POST /api/packages
{
"documents": [
{
"id": "Document1",
"name": "Document1",
"extract": true,
"extractionTypes": [
"TEXT_TAGS"
]
}
],
"status": "SENT",
"type": "PACKAGE",
"roles": [
{
"id": "s1",
"signers": [
{
"email": "[email protected]",
"firstName": "John",
"lastName": "Smith",
"id": "s1"
}
],
"name": "s1"
},
{
"id": "s2",
"signers": [
{
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"id": "s2"
}
],
"name": "s2"
}
],
"name": "Text Tags Example Package"
}
If you can successfully test through the JSON, I think the issue might be related to how your code builds the transaction JSON. BTW, the modelling in your code "OneSpanDocument", "OneSpanRole" doesn't sound like our .NET SDK. Either way, is there any chance you can monitor the outbound JSON from your end and compare the structure against the above example?
Duo
Reply to: Using text tags without knowing exact signers of document
Wednesday, April 12, 2023 at 04:03pmThis is excellent, thank you! I think I was mistaken, it appears these are our own models which we then convert into calls into OneSpan (I can't say if we use the SDK or REST at the moment, but it looks to me that this answer is applicable to both.
We will look into making sure we are integrating how you show here. However, we are definitely going to need to know a bit more about this:
If s2 doesn't have any signature, he/she will become a reviewer. We can add an additional step to remove all recipients who doesn't have signatures after the creation
Could you provide a little guidance on this part?
Thanks,
Ron
Reply to: Using text tags without knowing exact signers of document
Thursday, April 13, 2023 at 09:33amHi Ron,
You can leave the transaction in DRAFT status when initial creation, then get the package JSON after extraction and loop through "documents" > "approvals" > "role" to check which signer has signature. For signers who doesn't have signature, you can remove them using this API:
DELETE /api/packages/{packageId}/roles/{roleId}
I have attached an example code in RESTful code.
Duo