createDocFromTemplate

Create document via Template

Overview

Parameters:

Return:

  • DocResponse - In case of success

  • Exception - In case of failure

To create this document we will need:

  • set your apiToken;

  • build your signers;

  • build the document;

  • call the method.

How to use:

Save your apiToken:

const apiToken: string = "YOUR TOKEN";

Add your variables to a list of type DeParaTemplate:

const fromToTemplateName: DeParaTemplateBuilder = deParaTemplateBuilder()
        .de("{{FULL NAME}}") // the variable
        .para("Jhon Doe") // the value to replace
        .build();
        
const fromToTemplateSocialSecurty: DeParaTemplateBuilder = deParaTemplateBuilder()
        .de("{{Social Security Number}}")
        .para("9999999999")
        .build();
        
const fromToTemplateAdress: DeParaTemplateBuilder = deParaTemplateBuilder()
        .de("{{Full address}}")
        .para("999 N Main St")
        .build();
        
let fromToTemplates: DeParaTemplatesBuilder[] = [];

fromToTemplates.push(fromToTemplateName, fromToTemplateSocialSecurty, fromToTemplateAdress);

Build your document with DocFromTemplate class:

Finally, call the createDocFromTemplate method to get the DocResponse return or an error message:

Example:

Last updated

Was this helpful?