Templates makes it easy to sign documents that you sign regularly, for example, claim forms, attendance forms, leave applications, etc.
This sample code will show a developer to quickly automate a workflow with a template using the SigningHub API.
Simple workflow (with
template)
Overview
For the sample workflow, a PDF
document will be sent to SigningHub for manual signing. The signature
block will be placed with the help of a pre-configured template.
The API will be used to send the
document to SigningHub and configure the workflow and apply the
template. The Signer will then sign the document by logging into
SigningHub and manually signing the document with an electronic
signature.
For a discussion on the difference
between electronic signatures and digital signatures see the LAWtrust
article.
Sample code
Prerequisites
The template must have been created
and exist on SigningHub before this sample can be used.
To create a template see the
SigningHub online documentation:
https://manuals.ascertia.com/SigningHubv7/default.aspx#pageid=1145
For electronic signatures there are
no prerequisites for the user to be enrolled on SigningHub.
Sample code
The sample
code in this example, can be downloaded here.
Use Case
SigningHub templates helps
developers and administrators to manage workflows and documents that
are signed of frequently.
Sign off processes like claims
forms, leave applications, request for resources, indemnity forms,
Terms and Agreement can easily be signed with SigningHub templates.
Process flow

At a high level, the sample code
will perform the following steps:
-
Prepare the workflow by
applying a template.
-
Share the document.
-
SigningHub sends email
notification to Signer.
-
Signers logs into SigningHub
and signs the document.
-
Third-party downloads signed
document.
-
Third-party downloads the
forensic Workflow Evidence report.
-
Deletes the document.
Requests

The following requests must be
called to share a document with one Signer. The digital signing
process will be completely automated.
Step 1 – Authenticate
Overview
|
Authenticate to SigningHub.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHub-apiguide/default.aspx#pageid=1010.
|
Description
|
Authenticate to SigningHub, to start
transacting with SigningHub.
The required parameters will be
supplied by LAWtrust.
Contact
LAWtrust sales to get access to the testing environment.
|
Parameters
|
The scope parameter tells the
system who the Document Owner is. Use the email address of the
Document Owner to identify the owner.
If this parameter is not set, the
integration account used to authenticate to SigningHub will be
considered to be the Document Owner.
Take note of the access_token
returned by the server. The access_token will be needed in
subsequent requests.
|
Step 2 – Add Package
Overview
|
Create a package to upload documents
to.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHub-apiguide/default.aspx#pageid=1020.
|
Description
|
The first step to creating a
workflow on SigningHub is to create a package. This step tells the
system what the name of the pack is that you want to create.
A package can contain one or more
documents.
|
Parameters
|
The access_token is obtained
during Step 1 - Authenticate.
Take note of the package_id
returned by the server. The package_id will be needed in
the subsequent requests.
|
Step 3 – Upload document
Overview
|
Upload a document to the package
created in the previous step.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHub-apiguide/default.aspx#pageid=1022.
|
Description
|
Upload the document that must be
digitally signed to the system.
|
Parameters
|
The access_token is obtained
during Step 1 - Authenticate.
The document_id returned by
the server will be needed in requests pertaining to the uploaded
document.
|
Step 4 –
Apply template
Overview
|
Apply the template to the workflow.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHub-apiguide/default.aspx#pageid=1024.
|
Description
|
This request will apply the template
to the document. The template will specify where the signature
block will be placed on the document.
The template must exist on
SigningHub. To create a template, see the online documentation:
https://manuals.ascertia.com/SigningHubv7/default.aspx#pageid=1145
|
Parameters
|
The access_token is obtained
during Step 1 - Authenticate.
The package_id is obtained
during Step 2 – Create Package.
The field template_name
specifies the name of the template to apply.
The field apply_to_all is a
Boolean field. If true, SigningHub will apply the template
to all the documents in the package that must be signed. If false,
the template will only be applied to the document specified in the
field document_id.
|
Step 5 – Update workflow user
Overview
|
Add a signer to the workflow.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHub-apiguide/default.aspx#pageid=1047.
|
Description
|
Add the name and email address of
the person that must sign the document.
|
Parameters
|
The access_token is obtained
during Step 1 - Authenticate.
The package_id is obtained
during Step 2 – Create Package.
Set the field email_notification
to true. This field will tell SigningHub to send an email
notification with a link to the document to be signed to the
Signer.
|
Step 6 – Share document
Step 6.1 – Signer signs the document
Overview
|
For this step no request is sent to
SigningHub via the API. The signer logs into SigningHub and
manually signs the document.
This is a manual step performed by
the user and as such there is no requests to call.
To programmatically sign a document,
see the sample: One Signer
workflow.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHubv7/default.aspx#pageid=1156.
|
Description
|
The Signer manually signs the
document.
|
Parameters
|
N/A
|
Step 7 – Get document status (Optional)
Overview
|
Get the workflow status.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHub-apiguide/default.aspx#pageid=1044.
|
Description
|
The document status request
retrieves the document’s current status.
Developers can use this request to
periodically retrieve a document’s status.
The document status will be
‘Pending’ until all the Signers have digitally signed the
document. After calling the document’s status will be
‘Completed’.
|
Parameters
|
N/A
|
Step 8 – Download document
Step 9 – Download Workflow Evidence report
(Optional)
Overview
|
Download the Forensic Workflow
Evidence Report document.
|
Online Documentation
|
https://manuals.ascertia.com/SigningHub-apiguide/default.aspx#pageid=1045.
|
Description
|
A forensic report (Workflow
completion report) can be downloaded optionally.
The forensic report contains an
audit trail of all the actions that happened during the signing
workflow.
The forensic report has been
digitally signed to proof that the audit trail has not been
tampered should a dispute arise later on.
|
Parameters
|
Provide the package_id of the
forensic report to download.
|
Step 10 – Delete document