Skip to content

pedroht/autentique-v2

Repository files navigation

AUTENTIQUE Api v2

🚀 Como usar

This package is so simple to use that it will save your time.

npm i autentique-v2

Set file .env

AUTENTIQUE_URL=https://api.autentique.com.br/v2
AUTENTIQUE_TOKEN="YOUR_TOKEN"
AUTENTIQUE_DEV_MODE="true" || "false"
# if TRUE, document will be created in mode sandbox

Summary

  1. Instance
  2. Documents
  3. Folders

1. Instance

Import library

import autentique from 'autentique-v2';

autentique.token = AUTENTIQUE_TOKEN;

📝 2. Documents

1 - List all documents with pagination

autentique.document.listAll(page); // if not isset page is equal 1

2 - List the document by id

autentique.document.listById(documentId);

3 - Create a document

const attributes = {
  document: {
    name: 'NOME DO DOCUMENTO',
  },
  signers: [
    {
      email: 'email@email.com',
      action: 'SIGN',
      positions: [
        {
          x: '50', // Posição do Eixo X da ASSINATURA (0 a 100)
          y: '80', // Posição do Eixo Y da ASSINATURA (0 a 100)
          z: '1', // Página da ASSINATURA
        },
        {
          x: '50', // Posição do Eixo X da ASSINATURA (0 a 100)
          y: '50', // Posição do Eixo Y da ASSINATURA (0 a 100)
          z: '2', // Página da ASSINATURA
        },
      ],
    },
    {
      email: 'email@email.com',
      action: 'SIGN',
    },
  ],
  file: 'https://www.documento.com.br/arquivo.pdf',
};

autentique.document.create(attributes);

4 - Sign the document by id

autentique.document.signById(documentId);

5 - Delete the document by id

autentique.document.deleteById(documentId);

6 - Move the document to a folder

autentique.document.moveToFolder({
  documentId,
  folderId,
});

7 - Move the document from current folder to target folder

autentique.document.moveToFolder({
  documentId,
  folderId,
  currentFolderId,
});

📁 3. Folders

1 - List all folders

autentique.folder.listAll(page); // if not isset page is equal 1

2 - List the folder by id

autentique.folder.listById(folderId);

3 - Create a folder

autentique.folder.create({
  folder: {
    name: 'FOLDER NAME',
  },
});

4 - List the folder contents by id

autentique.folder.listDocuments(folderId);

5 - Delete a folder

autentique.folder.deleteById(folderId);

About

Integração nodejs com a ferramenta autentique de assinatura digital de documentos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published