Using Templates for Standard Processes

The Story

In order not to have to create the same envelope again and again for constant situations, the seller creates a template that he/she can use for constant contract. To create a template and use it in constant situations does not only save time but also prevents mistakes such as for example a text field being forgotten.

Use Case Description

Following steps are necessary:

  1. Create a template
  2. Use the template

This case leads you through the process of creating a template with the UI and working with the template with the API. In order not to create the same envelope again and again this case explain how to create a template. Thus, time can be saved. First, we have to create a template with the UI. The following screenshot shows where you can find the template section:


Figure

Description
Templates Overview



  1. You can create a new template in this section
  2. Click this button to create the first template

If you click on “create your first template” the following window appears:

Create Template

You can either define a recipient for the template like it is shown in the figure above, or you can define placeholder. Note: If you define placeholders for your template you have to override them if you use the template.

Here you can find a figure of a template with two placeholders:

Edit Template

There you can configure all settings for the template. After the configurations you can update the template which is shown in the next screenshot:

FigureDescription


Update Template

  1. Update and save the template

After saving the template you can now use the Id of the template and work with the API. If you open the template you can see the template in the URL:

e. g.: https://demo.esignanywhere.net/Templates/Detail/##TemplateID##

It is also possible to retrieve the templateId with the following api call:

https://demo.esignanywhere.net/api/v6/template/find

Within this call you can search for the following:

{
  "SearchText": "string",
  "RecipientEmail": "string"
}

As response you will get the templateId and the name of the template.

Integration

Note: If you have defined placeholders for the template you want to use with the API, you have to override the email address of the placeholders.

To get the email addresses of the placeholders you need the get envelope API call (envelope/##templateId##). In the response in the section steps you can find the email address of the placeholder.

Please see the following configuration:

{
    "Id": "aa78a404-1234-1234-1234-8138065dc8a0",
    "EnvelopeStatus": "Template",
    "Name": "test",
    "Activities": [
        {
            "Id": "eaa13eaf-1234-1234-1234-8fbdb950f6a1",
            "Status": "Pending",
            "Action": {
                "Sign": {
                    "ContactInformation": {
                        "Email": "placeholderemail",
                        "GivenName": "_PlaceHolderFirstName",
                        "Surname": "_PlaceHolderLastName",
                        "LanguageCode": "EN"
                    }
                }
            }
        },
        {
            "Id": "9bf06031-1234-1234-1234-d58314c8f7aa",
            "Status": "Pending",
            "Action": {
                "Sign": {
                    "ContactInformation": {
                        "Email": "placeholderemail",
                        "GivenName": "_PlaceHolderFirstName",
                        "Surname": "_PlaceHolderLastName",
                        "LanguageCode": "EN"
                    }
                }
            }
        }
    ]
}

Create draft from template

Just add the templateId in the following api call (https://demo.esignanywhere.net/api/v6/template/createdraft). You can find a configuration in the next section. After finishing the api call you will get a draftId.

{
"TemplateId": "aa78a404-1234-1234-bd8b-8138065dc8a0"
}

As response you get the draftId. For more information about drafts please have a look at: Draft Story

Get template configuration

With the following api call (https://demo.esignanywhere.net/api/v6/template/{templateId}/configuration you get the complete configuration of the template. Please see the next sample:


{
  "MetaData": "string",
  "AddDocumentTimestamp": true,
  "ShareWithTeam": true,
  "LockFormFieldsOnFinish": true,
  "SendFinishedDocumentsToAllSignersAndMustView": true,
  "Activities": [
    {
      "Id": "string",
      "Action": {
        "SendCopy": {
          "RecipientConfiguration": {
            "PersonalMessage": "string"
          },
          "CopyingGroup": 0
        },
        "Sign": {
          "RecipientConfiguration": {
            "PersonalMessage": "string",
            "AuthenticationConfiguration": {
              "AccessCode": {
                "Code": "string"
              },
              "SmsOneTimePassword": {
                "PhoneNumber": "string"
              },
              "SwedishBankId": {
                "PersonalNumber": "string",
                "AllowAnyPersonalNumber": true
              },
              "OAuthAuthentications": [
                {
                  "ProviderName": "string",
                  "Validations": [
                    {
                      "FieldReferenceId": "string",
                      "ExpectedValue": "string"
                    }
                  ]
                }
              ],
              "SamlAuthentications": [
                {
                  "ProviderName": "string",
                  "Validations": [
                    {
                      "FieldReferenceId": "string",
                      "ExpectedValue": "string"
                    }
                  ]
                }
              ]
            },
            "SendEmails": true,
            "AllowAccessAfterFinish": true,
            "IncludedEmailAppLinks": {
              "Android": true,
              "iOS": true,
              "Windows": true
            },
            "AllowDelegation": true,
            "RequireViewContentBeforeFormFilling": true
          },
          "FinishActionConfiguration": {
            "SignAnyWhereViewer": {
              "RedirectUri": "string"
            },
            "SignificantClientSignatureCaptureForIos": {
              "RemoveDocumentFromRecentDocumentList": true,
              "CallClientActionOnlyAfterSuccessfulSync": true,
              "CloseApp": true,
              "RedirectUri": "string"
            },
            "SignificantClientSignatureCaptureForAndroid": {
              "RemoveDocumentFromRecentDocumentList": true,
              "CallClientActionOnlyAfterSuccessfulSync": true,
              "CloseApp": true,
              "RedirectUri": "string"
            },
            "SignificantClientSignatureCaptureForWindows": {
              "RemoveDocumentFromRecentDocumentList": true,
              "CallClientActionOnlyAfterSuccessfulSync": true,
              "CloseApp": true,
              "RedirectUri": "string"
            },
            "KioskSdk": {
              "RedirectUri": "string"
            }
          },
          "SignatureDataConfiguration": {
            "DisposableCertificate": {
              "DocumentIssuingCountry": "string",
              "IdentificationIssuingCountry": "string",
              "IdentificationType": "None",
              "PhoneNumber": "string",
              "DocumentType": "IdentityCard",
              "DocumentIssuedBy": "string",
              "DocumentIssuedOn": "2023-04-18",
              "DocumentExpiryDate": "2023-04-18",
              "SerialNumber": "string",
              "DocumentNumber": "string"
            },
            "RemoteCertificate": {
              "UserId": "string",
              "DeviceId": "string"
            },
            "SwissComOnDemand": {
              "PhoneNumber": "string",
              "CommonName": "string",
              "Country": "string",
              "Locality": "string",
              "OrganizationUnit": "string",
              "Organization": "string",
              "SerialNumber": "string",
              "StateOrProvince": "string",
              "Pseudonym": "string"
            },
            "SmsOneTimePassword": {
              "PhoneNumber": "string"
            },
            "ATrustCertificate": {
              "PhoneNumber": "string"
            },
            "SwedishBankId": {
              "PersonalNumber": "string",
              "AllowAnyPersonalNumber": true
            },
            "SignaturePluginData": [
              {
                "PluginId": "string",
                "Fields": [
                  {
                    "Key": "string",
                    "Value": "string"
                  }
                ]
              }
            ]
          },
          "BatchConfiguration": {
            "Mode": "Basic",
            "RequireScrollingOverAllSignaturesBeforeSigning": true
          },
          "SigningGroup": 0
        },
        "View": {
          "RecipientConfiguration": {
            "PersonalMessage": "string",
            "AuthenticationConfiguration": {
              "AccessCode": {
                "Code": "string"
              },
              "SmsOneTimePassword": {
                "PhoneNumber": "string"
              },
              "SwedishBankId": {
                "PersonalNumber": "string",
                "AllowAnyPersonalNumber": true
              },
              "OAuthAuthentications": [
                {
                  "ProviderName": "string",
                  "Validations": [
                    {
                      "FieldReferenceId": "string",
                      "ExpectedValue": "string"
                    }
                  ]
                }
              ],
              "SamlAuthentications": [
                {
                  "ProviderName": "string",
                  "Validations": [
                    {
                      "FieldReferenceId": "string",
                      "ExpectedValue": "string"
                    }
                  ]
                }
              ]
            },
            "SendEmails": true,
            "AllowAccessAfterFinish": true
          },
          "ViewingGroup": 0
        },
        "SignAsP7M": {
          "RecipientConfiguration": {
            "PersonalMessage": "string",
            "AuthenticationConfiguration": {
              "AccessCode": {
                "Code": "string"
              },
              "SmsOneTimePassword": {
                "PhoneNumber": "string"
              },
              "SwedishBankId": {
                "PersonalNumber": "string",
                "AllowAnyPersonalNumber": true
              },
              "OAuthAuthentications": [
                {
                  "ProviderName": "string",
                  "Validations": [
                    {
                      "FieldReferenceId": "string",
                      "ExpectedValue": "string"
                    }
                  ]
                }
              ],
              "SamlAuthentications": [
                {
                  "ProviderName": "string",
                  "Validations": [
                    {
                      "FieldReferenceId": "string",
                      "ExpectedValue": "string"
                    }
                  ]
                }
              ]
            },
            "SendEmails": true,
            "AllowAccessAfterFinish": true,
            "IncludedEmailAppLinks": {
              "Android": true,
              "iOS": true,
              "Windows": true
            },
            "AllowDelegation": true,
            "RequireViewContentBeforeFormFilling": true
          },
          "SignatureMethods": {
            "LocalCertificate": true,
            "DisposableCertificate": {
              "DocumentIssuingCountry": "string",
              "IdentificationIssuingCountry": "string",
              "IdentificationType": "None",
              "PhoneNumber": "string",
              "DocumentType": "IdentityCard",
              "DocumentIssuedBy": "string",
              "DocumentIssuedOn": "2023-04-18",
              "DocumentExpiryDate": "2023-04-18",
              "SerialNumber": "string",
              "DocumentNumber": "string"
            },
            "RemoteCertificate": {
              "UserId": "string",
              "DeviceId": "string"
            },
            "SignaturePluginData": [
              {
                "PluginId": "string",
                "Fields": [
                  {
                    "Key": "string",
                    "Value": "string"
                  }
                ]
              }
            ]
          },
          "SignAsP7MGroup": 0
        },
        "SignBulk": {
          "RecipientConfigurations": [
            {
              "RecipientConfiguration": {
                "PersonalMessage": "string",
                "AuthenticationConfiguration": {
                  "AccessCode": {
                    "Code": "string"
                  },
                  "SmsOneTimePassword": {
                    "PhoneNumber": "string"
                  },
                  "SwedishBankId": {
                    "PersonalNumber": "string",
                    "AllowAnyPersonalNumber": true
                  },
                  "OAuthAuthentications": [
                    {
                      "ProviderName": "string",
                      "Validations": [
                        {
                          "FieldReferenceId": "string",
                          "ExpectedValue": "string"
                        }
                      ]
                    }
                  ],
                  "SamlAuthentications": [
                    {
                      "ProviderName": "string",
                      "Validations": [
                        {
                          "FieldReferenceId": "string",
                          "ExpectedValue": "string"
                        }
                      ]
                    }
                  ]
                },
                "SendEmails": true,
                "AllowAccessAfterFinish": true,
                "IncludedEmailAppLinks": {
                  "Android": true,
                  "iOS": true,
                  "Windows": true
                },
                "AllowDelegation": true,
                "RequireViewContentBeforeFormFilling": true
              },
              "SignatureDataConfiguration": {
                "DisposableCertificate": {
                  "DocumentIssuingCountry": "string",
                  "IdentificationIssuingCountry": "string",
                  "IdentificationType": "None",
                  "PhoneNumber": "string",
                  "DocumentType": "IdentityCard",
                  "DocumentIssuedBy": "string",
                  "DocumentIssuedOn": "2023-04-18",
                  "DocumentExpiryDate": "2023-04-18",
                  "SerialNumber": "string",
                  "DocumentNumber": "string"
                },
                "RemoteCertificate": {
                  "UserId": "string",
                  "DeviceId": "string"
                },
                "SwissComOnDemand": {
                  "PhoneNumber": "string",
                  "CommonName": "string",
                  "Country": "string",
                  "Locality": "string",
                  "OrganizationUnit": "string",
                  "Organization": "string",
                  "SerialNumber": "string",
                  "StateOrProvince": "string",
                  "Pseudonym": "string"
                },
                "SmsOneTimePassword": {
                  "PhoneNumber": "string"
                },
                "ATrustCertificate": {
                  "PhoneNumber": "string"
                },
                "SwedishBankId": {
                  "PersonalNumber": "string",
                  "AllowAnyPersonalNumber": true
                },
                "SignaturePluginData": [
                  {
                    "PluginId": "string",
                    "Fields": [
                      {
                        "Key": "string",
                        "Value": "string"
                      }
                    ]
                  }
                ]
              }
            }
          ],
          "FinishActionConfiguration": {
            "SignAnyWhereViewer": {
              "RedirectUri": "string"
            },
            "SignificantClientSignatureCaptureForIos": {
              "RemoveDocumentFromRecentDocumentList": true,
              "CallClientActionOnlyAfterSuccessfulSync": true,
              "CloseApp": true,
              "RedirectUri": "string"
            },
            "SignificantClientSignatureCaptureForAndroid": {
              "RemoveDocumentFromRecentDocumentList": true,
              "CallClientActionOnlyAfterSuccessfulSync": true,
              "CloseApp": true,
              "RedirectUri": "string"
            },
            "SignificantClientSignatureCaptureForWindows": {
              "RemoveDocumentFromRecentDocumentList": true,
              "CallClientActionOnlyAfterSuccessfulSync": true,
              "CloseApp": true,
              "RedirectUri": "string"
            },
            "KioskSdk": {
              "RedirectUri": "string"
            }
          },
          "BatchConfiguration": {
            "Mode": "Basic",
            "RequireScrollingOverAllSignaturesBeforeSigning": true
          }
        }
      },
      "VisibilityOptions": [
        {
          "DocumentNumber": 0,
          "IsHidden": true
        }
      ]
    }
  ],
  "EmailConfiguration": {
    "Subject": "string",
    "Message": "string",
    "SenderDisplayName": "string"
  },
  "ReminderConfiguration": {
    "Enabled": true,
    "FirstReminderInDays": 0,
    "ReminderResendIntervalInDays": 0,
    "BeforeExpirationInDays": 0
  },
  "ExpirationConfiguration": {
    "ExpirationInSeconds": 0,
    "ExpirationDate": "2023-04-18T08:26:01.208Z"
  },
  "CallbackConfiguration": {
    "CallbackUrl": "string",
    "StatusUpdateCallbackUrl": "string",
    "AfterSendCallbackUrl": "string",
    "ActivityActionCallbackConfiguration": {
      "Url": "string",
      "ActionCallbackSelection": {
        "ConfirmTransactionCode": true,
        "AgreementAccepted": true,
        "AgreementRejected": true,
        "PrepareAuthenticationSuccess": true,
        "AuthenticationFailed": true,
        "AuthenticationSuccess": true,
        "AuditTrailRequested": true,
        "AuditTrailXmlRequested": true,
        "CalledPage": true,
        "DocumentDownloaded": true,
        "FlattenedDocumentDownloaded": true,
        "AddedAnnotation": true,
        "AddedAttachment": true,
        "AppendedDocument": true,
        "FormsFilled": true,
        "ConfirmReading": true,
        "SendTransactionCode": true,
        "PrepareSignWorkstepDocument": true,
        "SignWorkstepDocument": true,
        "UndoAction": true,
        "WorkstepCreated": true,
        "WorkstepFinished": true,
        "WorkstepRejected": true,
        "DisablePolicyAndValidityChecks": true,
        "EnablePolicyAndValidityChecks": true,
        "AppendFileToWorkstep": true,
        "AppendTasksToWorkstep": true,
        "SetOptionalDocumentState": true,
        "PreparePayloadForBatch": true
      }
    }
  },
  "AgreementConfiguration": {
    "Translations": [
      {
        "LanguageCode": "AF",
        "Text": "string",
        "Header": "string",
        "IsDefault": true
      }
    ]
  },
  "AgentRedirectConfiguration": {
    "Policy": "Workflow",
    "Allow": true,
    "IFrameAllowList": [
      "string"
    ]
  },
  "RedirectConfiguration": {
    "AfterSendRedirectUrl": "string",
    "BeforeSendRedirectUrl": "string"
  },
  "DefaultSignatureTypeConfiguration": {
    "ClickToSign": {
      "IsDefault": true
    },
    "DrawToSign": {
      "IsDefault": true
    },
    "TypeToSign": {
      "IsDefault": true
    },
    "LocalCertificate": {
      "IsDefault": true
    },
    "DisposableCertificate": {
      "IsDefault": true
    },
    "Biometric": {
      "IsDefault": true
    },
    "RemoteCertificate": {
      "IsDefault": true
    },
    "OneTimePassword": {
      "IsDefault": true
    }
  }
}