placeSignatures

place the signatures

Overview

Parameters:

Return:

  • int - In case of success

  • Exception - In case of failure

To place the rubrics/signatures on the document we will need:

  • set your apiToken;

  • document token;

  • build the rubrics;

  • call the method;

How to use:

Save your apiToken:

const apiToken: string = "YOUR TOKEN";

Set your original document`s token:

const docToken: string = "ORIGINAL DOCUMENT TOKEN";

Build your rubrics and save them on RubricaList wich will be an array of Rubrica:

const rubrica1: RubricaBuilder = rubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(52.50)
                .withRelativePositionLeft(75.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
const rubrica2: RubricaBuilder = rubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(13.50)
                .withRelativePositionLeft(20.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
let rubricas = RubricaBuilder[];
rubricas.push(rubrica1, rubrica2);

const rubricasArray = new RubricaArray(rubricas);

Call the placeSignatures method to get the response`s status code or an error message:

async function exempleAddExtraDoc() {
        try {
                statusCode: number = await new DocRequests(apiToken).placeSignatures(docToken, rubricasArray);
                console.log(statusCode);
        } catch(Err) {
            console.log(Err);
        }
    }
}

Example:

import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { RubricaBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/RubricaBuilder";
import { RubricasArray } from "sdk-node-typescript-zapsign/src/body/doc/RubricasArray";

const apiToken: string = "YOUR TOKEN";

const docToken: string = "ORIGINAL DOCUMENT TOKEN";

const rubrica1: RubricaBuilder = RubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(52.50)
                .withRelativePositionLeft(75.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
const rubrica2: RubricaBuilder = rubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(13.50)
                .withRelativePositionLeft(20.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
let rubricas = RubricaBuilder[];
rubricas.push(rubrica1, rubrica2);

const rubricasArray = new RubricasArray(rubricas);

async function exempleAddExtraDoc() {
        try {
                statusCode: number = await new DocRequests(apiToken).placeSignatures(docToken, rubricasArray);
                console.log(statusCode);
        } catch(Err) {
            console.log(Err);
        }
    }
}

Last updated