const apiToken: string = "SEU TOKEN";
const docToken: string = "TOKEN DOCUMENTO ORIGINAL";
const rubrica1: RubricaBuilder = rubricaBuilder()
.withPage(0)
.withtRelativePositionBottom(52.50)
.withRelativePositionLeft(75.71)
.withRelativeSizeX(19.55)
.withRelativePositionSizeY(9.42)
.withType("signature")
.withSignerToken("TOKEN SIGNER")
.build();
const rubrica2: RubricaBuilder = rubricaBuilder()
.withPage(0)
.withtRelativePositionBottom(13.50)
.withRelativePositionLeft(20.71)
.withRelativeSizeX(19.55)
.withRelativePositionSizeY(9.42)
.withType("signature")
.withSignerToken("TOKEN SIGNER")
.build();
let rubricas = RubricaBuilder[];
rubricas.push(rubrica1, rubrica2);
const rubricasArray = new RubricaArray(rubricas);
Chame o método placeSignatures e receba como resposta um inteiro contendo o status code da resposta ou uma mensagem de erro:
async function exempleAddExtraDoc() {
try {
statusCode: number = await new DocRequests(apiToken).placeSignatures(docToken, rubricasArray);
console.log(statusCode);
} catch(Err) {
console.log(Err);
}
}
}
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 = "SEU TOKEN";
const docToken: string = "TOKEN DOCUMENTO ORIGINAL";
const rubrica1: RubricaBuilder = RubricaBuilder()
.withPage(0)
.withtRelativePositionBottom(52.50)
.withRelativePositionLeft(75.71)
.withRelativeSizeX(19.55)
.withRelativePositionSizeY(9.42)
.withType("signature")
.withSignerToken("TOKEN SIGNER")
.build();
const rubrica2: RubricaBuilder = rubricaBuilder()
.withPage(0)
.withtRelativePositionBottom(13.50)
.withRelativePositionLeft(20.71)
.withRelativeSizeX(19.55)
.withRelativePositionSizeY(9.42)
.withType("signature")
.withSignerToken("TOKEN SIGNER")
.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);
}
}
}