Create a new Template

Using templates is a great time-saving hack that helps boost your productivity. ValidSign offers the ability to create and use templates to help automate the e-signature process for frequently used documents such as contracts and NDAs. With templates, you can pre-define your signers, documents, signature locations and e-signature workflows. Instead of spending time placing signature blocks and data fields over and over again in a contract you frequently send out for e-signature, set them once and reuse the template. 

Introduction

Introduction of Templates

Using templates is a great time-saving hack that helps boost your productivity. ValidSign offers the ability to create and use templates to help automate the e-signature process for frequently used documents such as contracts and NDAs. With templates, you can pre-define your signers, documents, signature locations and e-signature workflows. Instead of spending time placing signature blocks and data fields over and over again in a contract you frequently send out for e-signature, set them once and reuse the template.

Manage Templates using the API

Creating a New Template

The sample code below demonstrates how to create a new template, with one document and two signers.

POST /api/packages

 ------WebKitFormBoundary1bNO60n7FqP5WO4t
 Content-Disposition: form-data; 
 name="file"; 
 filename="testDocumentExtraction.pdf"   
 Content-Type: application/pdf   
 %PDF-1.5   %µµµµ   1 0 obj   <>>>   endobj....   
 ------WebKitFormBoundary1bNO60n7FqP5WO4t   
 Content-Disposition: form-data; name="payload"   
{
    "name": "My template from scratch REST",
    "visibility": "ACCOUNT",
    "description": "",
    "roles":
    [
        {
            "name": "Signer1",
            "index": 0,
            "id": "Signer1"
        },
        {
            "name": "Signer2",
            "index": 0,
            "id": "Signer2"
        }
    ],
    "type": "TEMPLATE",
    "autocomplete": true,
    "emailMessage": "",
    "documents":
    [
        {
            "name": "Example Document",
            "extract": true,
            "extractionTypes":
            [
                "TEXT_TAGS"
            ]
        }
    ]
}
 ------WebKitFormBoundary1bNO60n7FqP5WO4t--
DocumentPackage documentPackage = newPackageNamed(getPackageName())
    .describedAs("My template")
    .withSigner(newSignerWithEmail("signer1@example.com")
        .withFirstName("Firstname")
        .withLastName("Lastname"))
    .withDocument(newDocumentWithName("Example Document")
      .fromFile("your_file_path")
      .withExtractionType(ExtractionType.TEXT_TAGS)
      .enableExtraction())
    .build();

templateId = eslClient.getTemplateService().createTemplate(documentPackage);
FileStream fs = File.OpenRead("your_file_path");

DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("My template")
   .WithSigner(SignerBuilder.NewSignerWithEmail("signer1@example.com")
      .WithFirstName("Firstname")
      .WithLastName("Lastname")
      .WithCustomId("Signer1"))
   .WithSigner(SignerBuilder.NewSignerWithEmail("signer2@example.com")
      .WithFirstName("Firstname")
      .WithLastName("Lastname")
      .WithCustomId("Signer2"))
   .WithDocument(DocumentBuilder.NewDocumentNamed("Example Document")
      .FromStream(fs, DocumentType.PDF)
      .WithExtractionType(ExtractionType.TEXT_TAGS)
      .EnableExtraction())
   .Build();

PackageId templateId = ossClient.CreateTemplate(documentPackage);
Creating a New Template from a Transaction

You can also create a template by using an existing transaction as the basis for your template. For this, you will need the packageId of your transaction.

POST /api/packages/{packageId}/clone

{
    "name": "Your cloned Template",
    "autocomplete": true,
    "settings":
    {
        "ceremony":
        {
            "inPerson": false
        }
    },
    "type": "TEMPLATE",
    "visibility": "ACCOUNT",
    "language": "en"
}
PackageId packageId = new PackageId("YOUR_PACKAGE_ID");

PackageId templateFromPackage = eslClient.getTemplateService()
.createTemplateFromPackage(packageId, "Your cloned Template" );
PackageId packageId = new PackageId("YOUR_PACKAGE_ID");

PackageId templateFromPackage = eslClient.CreateTemplateFromPackage(packageId, "Your cloned Template");