PHP code example of agrobens / sdk-php-autentique

1. Go to this page and download the library: Download agrobens/sdk-php-autentique library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

agrobens / sdk-php-autentique example snippets


use vinicinbgs\Autentique\Documents;

$AUTENTIQUE_TOKEN="xxxxxxxx" (set or will be take in .env)

$documents = new Documents($AUTENTIQUE_TOKEN);

$folders = new Folders($AUTENTIQUE_TOKEN);

$documentsPaginated = documents->listAll($page); // if not isset $page is equal 1

$document = $documents->listById($documentId);

$attributes = [
         'document' => [
             'name' => 'NOME DO DOCUMENTO',
         ],
         'signers' => [
             [
                 'email' => '[email protected]',
                 '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 protected]',
                 '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
                     ],
                 ],
             ],
         ],
         'file' => './dummy.pdf',
     ];
 
 $documentCreated = $documents->create($attributes);
 

$documentSign = $documents->signById($documentId);

$documentDeleted = $documents->deleteById($documentId);

$attributes = [
    "folder" => [
                "name" => "folder name",
            ],
];
 
$folder = $folders->create($attributes);
$documentDeleted = $documents->moveToFolder($documentId, $folder["data"]["createFolder"]["id"]);

$documentDeleted = $documents->moveToFolderByFolder($documentId, $targetFolderId, $currentFolderId);

$foldersPaginated = $folders->listAll($page); // if not isset $page is equal 1

$folder = $folders->listById($folderId);

$attributes = [
    "folder" => [
                "name" => "folder name",
            ],
];
 
$folder = $folders->create($attributes);
 

$folderContents = $folders->listContentsById($folderId, $page = 1);
 
$folderDeleted = $folders->deleteById($folderId);