addSigner

add signer

Overview

Parameters:

Return:

  • Signer - In case of success

  • Exception - In case of failure

To add a signer we will need:

  • set your apiToken;

  • set your document token;

  • build a new signer;

  • call the method;

How to use:

Save your apiToken:

const apiToken: string = "YOUR TOKEN";

Set the signer token:

const signerToken: string = "SIGNER TOKEN";

Build your signer with the Signer class:

const signerBuilder = SignerBuilder()
    .withName("New Signer Name")
    .withEmail("newEmail@test.com")
    .withLockEmail(true)
    .withLockPhone(true)
    .withPhoneCountry("55")
    .withPhoneNumber("999999999")
    .withAuthMode("assinaturaTela") // draw on screen
    .withSendAutomaticAemail(false)
    .withSendAutomaticWhatsApp(false)
    .build();

Call the addSigner method to get the Signer or an error message:

async function exempleAddSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).addSigner(signerToken, signer);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }    
}

Example:

import SignerRequest from "sdk-node-typescript-zapsign/src/signer/SignerRequest";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { SignerBuilder } from "sdk-node-typescript-zapsign/src/body/signer/builders/SignerBuilder";

const apiToken: string = "SEU TOKEN";
const docToken: string = "TOKEN DOCUMENTO";

const signerBuilder = SignerBuilder()
    .withName("New Signer Name")
    .withEmail("newEmail@test.com")
    .withLockEmail(true)
    .withLockPhone(true)
    .withPhoneCountry("55")
    .withPhoneNumber("999999999")
    .withAuthMode("assinaturaTela") // draw on screen
    .withSendAutomaticAemail(false)
    .withSendAutomaticWhatsApp(false)
    .build();
    
async function exempleAddSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).addSigner(signerToken, signer);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }    
}