Templates and replacing documents
Wednesday, June 15, 2022 at 02:01pmWe have a web UI with the iframe approach for the e-signature ceremony but we appear to lose the signature field when cloning the template.
Our steps are as follows:
- post /packages/{templateId}/clone -- initialize transaction
-
post /packages/{packageId}/documents -- replace PDF with customized document
-
put /packages/${packageId} -- update the transaction
-
post /signerAuthenticationTokens -- get token for the iframe
This more or less works, we get the iframe with the updated PDF, but the signature field is missing. Does this mean we have to capture the approvals object in the definition of the template and reapply it during the transaction update?
Thank you
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 03:29pmHi Rob,
Thanks for your post!
As per your description, a quick fix is for step2, you need to include a payload at least with the "id" and "name" (id has to be the same, name can be customizable), see below:
POST /api/packages/{packageId}/documents
{
"id": "92e171673a1144037ec21a935f1cdfe4558b1b71461b8dca",
"name": "some new name"
}
Besides that, actually the standard practice for this use case is to save the signatures and fields as a layout, and apply the layout to the newly created transaction.
Duo
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 03:50pmHello,
we were already providing a payload similar to what you describe when updating the documents, so the source of the problem is somewhere else.
The issue we have with using Layouts is that we do not wish to provide fields other than the customer signature, as the PDF we provide as a replacement for the template document is used in other parts of the solution and contains all the information pertaining to the specific customer. It is however of the same dimensions as the template so the signature location would match.
Knowing this, would you still recommend to use a Layout, or do you think we could add the Approvals object after replacing the PDF?
Thank you
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 03:58pmHi Rob,
Which environment are you developing with? Can you provide the template ID and a cloned transaction ID that has the signature missing? You can also try to invoke a GET call first (GET /api/packages/{packageId}/documents/{documentId}) and use the payload with "approvals" information when invoke the POST document call (but from my test, this is not necessary).
For the layout solution, the layout itself won't store any sensitive information about specific customers, if you saved the layout as signature-only, then the applied layout won't have any additional fields.
Duo
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 04:14pmHello,
the solution is built using your REST API. Interactions with OneSpan API take place in NodeJS (Axios calls inside AWS Lambda functions) and the iframe is part of a React front-end.
A template in our sandbox: "MBXLLo7X351YnFEv5LuGOmk1p4o=". A clone of this template: "xizWVT4Pd4774IEq80T939_gA-0=".
The only payload sent to the /documents endpoint is the id and name.
The payload passed to the /clone endpoint looks like this:
let packageInfo = {
name: "[redacted]",
description: '[redacted]',
autocomplete: true,
emailMessage: "Please review the questions and answers carefully",
type: "PACKAGE",
status: 'SENT',
visibility: "SENDER",
due: moment().add(1, 'days').format('YYYY-MM-DD'),
language: 'en',
"settings":
{ "ceremony":
{
"disableDialogOnComplete": true,
"documentToolbarOptions": { "downloadButton": true },
"layout": { "footer": {}, "navigator": true, "declineButton": false, "disableDownloadForUncompletedPackage": true, "hideLanguageDropdown": true, "optOutButton": false },
"inPerson": false
}
}
Ideally we would not have emails sent at all so the emailMessage will likely go away.
Thank you
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 04:28pmHi Rob,
For this transaction "xizWVT4Pd4774IEq80T939_gA-0=", from what I saw in the backoffice, the signature is there at below location and the signer has completed signing:
"page": 7,
"top": 785.9994711697102,
"left": 58.99997783589363,
"width": 285.0002895462513,
"height": 45.99997831273079,
Duo
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 04:33pmHello,
the signature field did not appear in the iframe. The signature was done by clicking on the email link and going to OneSpan website to complete the transaction.
This is essentially our problem, we want the signature to take place in the iframe, not following an email.
If you want to see an incomplete package due, see "gEgKPf_BsoMbjA-OlognReG5-zI=". It is based on the same template but we did not click the link in the email and there was no way to sign in the iframe.
Thank you
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 04:52pmThanks for the information, this is more clear to me now. However, I followed the same process but can't reproduce the same issue at my side - there's still signature in my iFrame. Can you generate a testing signer authentication token and send to [email protected]? (The signer auth token will only be valid for 15 minutes)
Duo
Reply to: Templates and replacing documents
Wednesday, June 15, 2022 at 04:54pmBTW, the "Go to Document" link behind the email is the signing URL, you can also generate the link via this API and embed it into your iFrame:
GET /api/packages/{packageId}/roles/{roleId}/signingUrl
Check below blog for more details about signing URL vs signer Authentication Token link:
https://www.onespan.com/blog/onespan-sign-developer-session-authentication-token-and-signing-url-part1
Duo