updateSigner

update signer

Overview

Parameter:

Retorno:

  • Signer - In case of success

  • Exception - In case of failure

To update the signer we will need:

  • set your apiToken;

  • set your signer token;

  • set the new signer`s values.

  • call the method.

How to use:

Save your apiToken:

const apiToken: string = "YOUR TOKEN";

Set your 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();

Finally, call the addSigner method to get the Signer or an error message:

async function exempleUpdateSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).updateSigner(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 = "YOUR TOKEN";

const signerToken: string = "SIGNER TOKEN";

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 exempleUpdateSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).updateSigner(signerToken, signer);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }    
}

Last updated