Copy const apiToken : string = "SEU TOKEN" ;
Copy const base64 : string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."
Copy const signer1 : Signer = new SignerBuilder ()
.withName ( "My First Signer" )
.build ();
const signer2 : Signer = new SignerBuilder ()
.withName ( "My Second Signer" )
.withEmail ( "test@test.com" )
.withLockEmail ( true )
.withLockPhone ( true )
.withPhoneCountry ( "55" )
.withPhoneNumber ( "99999999999" )
.withAuthMode ( "assinaturaTela" )
.withSendAutomaticEmail ( false )
.withSendAutomaticWhatsapp ( false )
.build ();
let signers : Signer [] = [];
signers .push (signer1 , signer2);
Copy const docFromPdfBase64 = DocFromPdfBase64Builder ()
.withSandbox ( false )
.withName ( "My Contract" )
.withBrandPrimaryColor ( "#000000" )
.withBase64Pdf (base64)
.build ();
Copy try {
docResponse = new DocRequests (apiToken) .createDocFromPdfBase64 (docFromPdfBase64);
jsonDocResponse : string = new JsonConverter () .docResponseToJson (docResponse);
console .log (jsonDocResponse);
} catch {
console .log (Err);
}
Copy import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests" ;
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter" ;
const apiToken : string = "SEU TOKEN" ;
const base64 : string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKP..." ;
const signer1 : Signer = new SignerBuilder ()
.withName ( "My First Signer" )
.build ();
const signer2 : Signer = new SignerBuilder ()
.withName ( "My Second Signer" )
.withEmail ( "test@test.com" )
.withLockEmail ( true )
.withLockPhone ( true )
.withPhoneCountry ( "55" )
.withPhoneNumber ( "99999999999" )
.withAuthMode ( "assinaturaTela" )
.withSendAutomaticEmail ( false )
.withSendAutomaticWhatsapp ( false )
.build ();
let signers : Signer [] = [];
signers .push (signer1 , signer2);
const docFromPdfBase64 = DocFromPdfBase64Builder ()
.withSandbox ( false )
.withName ( "My Contract" )
.withBrandPrimaryColor ( "#000000" )
.build ();
async function exempleDocFRomPdfBase64Async () {
try {
docResponse : DocResponse = await new DocRequests (apiToken) .createDocFromPdfBase64Async (docFromPdfBase64);
jsonDocResponse : string = new JsonConverter () .docResponseToJson (docResponse);
console .log (jsonDocResponse);
} catch (Err) {
console .log (Err);
}
}
}