Namirial - eSignAnyWhere PDF signing

Namirial - eSignAnyWhere PDF signing

eSignAnyWhere is a third-party-solution to automate the digital signing of pdf-documents.

Via our eSignAnyWhere module you can generate PDF-files with InterFormNG2, send them to eSignAnyWhere incl. sign-fields like signatures, checkboxes, radio-buttons and text-fields. The signing from eSignAnyWhere can then happen e.g. via browser or a signpad. Once the document is finalized, InterFormNG2 can even process the signed document and fetch data from it (e.g. text that was typed in, status of signatures, etc.)
Notes
Note: that this functionality requires a license for the module "eSignAnyWhere"
Please refer to the Namirial website for information in regards to the correct setup for esignanywhere: https://www.esignanywhere.net/

Settings

Esaw – Create API-token
When you have an account with eSignAnyWhere you can configure the API server settings.
In InterFormNG2 settings, go to the section “eSignAnyWhere”. 
  • API version: From version 3.5.2 onwards we added a new field in the settings so you can choose between v5 and v6. The default is v5. Note that it is possible to use both API versions interchangeably, so if you have old v5 envelopes and some new v6 envelopes, you can just create two different settings instances with different versions and then in the workflow choose the settings instance that matches the used envelope version.

  • Access Token: For access token you need to create an API token in the settings on the eSignAnyWhere web site under “Api Tokens and Apps”. Copy-paste the generated token here.




  • Callback: Base URL for callbacks is optional and only needed if you want to be able to create a workflow that is executed when the signing process is complete. In a simple network setup, the callback URL is simply the domain or IP of InterFormNG2 including protocol, for instance https://18.100.45.32. However, note that if you are using the eSignAnyWhere cloud solution, then it only supports callbacks with HTTPS protocol and only on port 443. If you want the callback to go directly to InterFormNG2, then InterFormNG2 must be installed to use port 443 and use HTTPS protocol.


    (Example for settings within application-default-properties from an active installation.)


Firewall opening
To use eSignAnyWhere you must open port 443 on the firewall for outbound requests to the eSignAnyWhere API server.
To also allow callbacks from eSignAnyWhere to pass through, you need to open port 443 on the firewall so that inbound requests from the eSignAnyWhere service can pass through to InterFormNG2.
Optional Usage of Proxy

Specifically for eSignAnyWhere a solution has been made to support the usage of proxies. It requires setting these properties in application-default.properties
proxy.host=<proxyHostIp>
proxy.port=<proxyHostPort>
proxy.user=<username>
proxy.password=<password>


Design for eSignAnyWhere integration

The main challenge with integrating eSignAnyWhere is setting up the envelope configuration in InterFormNG2, since the eSignAnyWhere service offers a lot of complex configuration options for this.
To solve this without having to re-create the eSignAnyWhere designer in InterFormNG2, we make use of the eSignAnyWhere developer mode to design an envelope and export it in JSON format. InterFormNG2 will then use the JSON file to create envelopes.
Creating the envelope template
To create the envelope template, a user with “Developer” role on eSignAnyWhere must use the designer to create an envelope with the desired design and send it for signing.
For the first step we need to create an eSignAnywhere template. To do that we have to create a new document by pressing the button NEW DOCUMENT.

In this section we will have to give our envelope a name. So go ahead and give it any name you want. Thereafter we must upload a pdf document for creating the template. You can choose any PDF document you have. Lastly, we need to choose the recipient and press next at the bottom right corner. 


You can now see the PDF document in the next window and on your left side there are many options for configuration for the template. You can simply drag and drop the elements where you see fit and if you press on one of the elements a new window will appear on the right side which gives you even further options to configure the elements. When you are finished configuring your template design then you can press next on the bottom right corner.



In the signature settings you can define the ID of the elements, so you can refer to it later (e.g. when a signed document is returned to InterForm). You can also mark a field as mandatory.


In the next section you can press the send envelope button at the bottom right corner to send your document. It will be sent to your Email right after.

You would now have received an email from eSignAnywhere. Press Open document and proceed through the signing process.

When you are finished with the signing process then go back to eSignAnywhere and look in your documents you should now have a document you can select. When you select the document, which you created then you must press download and download the template in a json file.

Once signing is complete, download the envelope as JSON:



Modifying the envelope template for InterFormNG2
Next, open the JSON template in a text editor and modify it by replacing the fixed values with template fields as necessary:

For instance in the recipients element, you probably want to replace the recipient details with template fields. The template fields should have the format ##FieldName##.
Notes
Note: In the JSON format for API v6, the Recipients element has changed name to “ContactInformation”
Example for v6:
"Documents": [
   {
      "FileId": "##FileId##",,
      "DocumentNumber": 1
   }
],
"Action": {
    "Sign": {
        "RecipientConfiguration": {
            "ContactInformation": {
                "Email": "##RecipientEmail##",
                "GivenName": "##RecipientFirstName##",
                "Surname": "##RecipientLastName##",
                "PhoneNumber": "",
                "LanguageCode": "EN"
            },
"AllowDelegation": false
"RequireViewContentBeforeFormFilling": false
"CallbackConfiguration": {
    "CallbackUrl": "##CallbackUrl##"
}
Notes
Note: In the envelope format for API v6, it is also necessary to replace the document reference with ##FileId##:
"Documents": [
  {
    "DocumentNumber": 1,
    "FileId": "##FileId##"
  }
],
You can also add additional metadata (e.g. from InterFormNG2 variables):
"MetaData": "##meta1##;##meta2##;##meta3##;##meta4##;##meta5##",

Example for v5:
"Recipients": [
    {
      "Email": "##RecipientEmail##",
      "FirstName": "##RecipientFirstName##",
      "LastName": "##RecipientLastName##",
      "LanguageCode": "en",
      "EmailBodyExtra": "",
Do this for all values that should be configurable in the InterFormNG2 workflow.
If you want to use callbacks, then you also need to insert a template field for the callback URL in the field "CallbackUrl". This should always be "##CallbackUrl##".
Like this:
"CallbackUrl": "##CallbackUrl##",
It will be automatically replaced with the real callback value. If you do not want to use callbacks, then the CallbackUrl field should be left blank.
Save the envelope to InterFormNG2
Next, rename the file to have extension “.esignenvelope” and upload it in the “Others” library folder in InterFormNG2. Using this extension allows the system to recognize it as an eSignEnvelope and list it as an option in the workflow configuration.


Workflow Setup

Sending workflow

Now create the workflow in InterFormNG2. For the template fields in the envelope to be replaced with actual values, create workflow variables (e.g. with Set multiple workflow variables) with the same names as the template fields, and map them to values from the workflow input XML (note that the ##CallbackUrl## template field is handled automatically and does not need a mapping to a variable).



Notes
Note: you could add additional variables vie the envelope information “MetaData”.
You can separate several variables by a semicolon.
"MetaData": "##meta1##;##meta2##;##meta3##;##meta4##;##meta5##", 
Create the PDF from an InterFormNG2 template and then send it for signing using the template that was uploaded in the library using the component “Sign with eSignAnyWhere”.




In this component set “eSignAnyWhere server” to the server that was configured in settings. Set “Envelope template” to the path of a template that is stored in the “Other” library folder. If the files is saved in the library with “.esignevelope” extension, then it can be selected from a drop-down.
Set “Output filename” to the filename you want the signable PDF to have. When receiving the final PDF after the signing process, it will come as an attachment with this name.
Set “name of receiving workflow” to the name of the workflow that will be called when the signing process is complete. This can be selected from a drop-down if that workflow is already created.
Callback parameter 1, 2 and 3 can be set to any short text that you would like to receive again in the receiving workflow. Note that these are technically parameters on the callback URL, so using very long strings may cause problems. In the receiving workflow you can refer to the callback-parameters with $interform.esignanywhere.param.1 (or 2 and 3)

Receiving workflow




The callback will return an audittrail xml containing information from the signing and from the sending workflow.

You can fetch data from the xml by defining variables.
You can also refer to the callback-parameters with $interform.esignanywhere.param.1 (or 2 and 3)


Using a transformation or stylesheet to generate an output index-file or similar is usually a good idea.
If you want to fetch the signed document (pdf), you can use the attachment to payload function.


 
    • Related Articles

    • PDF/UA (Accessibility)

      Introduction To support accessibility requirements, InterFormNG2 can create PDF documents that are PDF/UA-1 compliant in accordance with ISO standard 14289-1:2014. UA is an abbreviation of Universal Accessibility. In e.g. Germany this is referenced ...
    • DigitalSign cloud PDF signing

      This component takes a PDF as input payload and returns a signed version of that PDF as output. This component can be used to sign a PDF document using the DigitalSign service called "Certificado Qualificado - Selo Eletrónico Cloud" (in portuguese). ...
    • Signing of Invoice PDF files for Portugal

      Digitally signing Invoices PDF files in Portugal is getting mandatory and for that it is required to use a cloud based DigitalSign server of the Tax authorities to digitally sign the PDF files. This is supported in InterFormNG2 with the DigitalSign ...
    • PDF input and output

      If you want to create PDF output in InterFormNG2, then you need to setup a workflow in InterFormNG2 to do that. If you want to use the PDF inside of an email, then you should consider to check out the email output options first, as the normal create ...
    • Create PDF document

      With this workflow component you can merge an input file with a template (both InterFormNG2 and InterFormNG templates) to create the output stream in PDF format. This can later e.g. be sent to a (laser) printer, that supports PDF or as input for e.g. ...