PHP Package for Autentique API-v2

Overview

AUTENTIQUE Api v2

Latest Stable Version Total Downloads Build Status codecov Scrutinizer Code Quality Code Intelligence Status License

🚀 Usage

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

composer require vinicinbgs/autentique-v2

⚠️ IMPORTANT

This library depends on vlucas/phpdotenv to get environments variables (.env)
If you use a framework like Laravel, you don't need to download this library.

composer require vlucas/phpdotenv

Set in file .env

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

Instance

Import library

use vinicinbgs\Autentique\Documents;

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

$documents = new Documents($AUTENTIQUE_TOKEN);

$folders = new Folders($AUTENTIQUE_TOKEN);

Why documents/folders receive token?

  • Easily to manage Documents in multiples accounts (token)

📝 Documents

1 - List all documents with pagination

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

2 - List the document by id

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

3 - Create a document

$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);

4 - Sign the document by id

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

5 - Delete the document by id

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

📁 Folders

1 - List all folders

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

2 - List the folder by id

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

3 - Create a folder

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

4 - List the folder contents by id

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

5 - Delete a folder

$folderDeleted = $folders->deleteById($folderId);

🔧 Contributing

💻 Setup

git clone [email protected]:vinicinbgs/autentique-v2.git
cd autentique-v2
composer install
npm install

⚙️ Configure

Create .env with variables

./contribute.sh

Configure prettier php in vscode

(CTRL + P) > Preferences: Open Setting (JSON)

 "emeraldwalk.runonsave": {
        "commands": [
            {
                "match": "\\.php$",
                "cmd": "npm run prettier -- ${relativeFile} --write",
            },
        ]
    }
Comments
  • I put the api token in the .env

    I put the api token in the .env

    I put the api token in the .env, but when I put the command to generate the document it gives error 400 preventing the api from working, any suggestions for a solution?

    image image

    opened by Adiniz21 5
  • Internal server error - Create a new document

    Internal server error - Create a new document

    When I try to create a document I get the message below: {"errors":[{"message":"Internal server error","extensions":{"category":"internal"},"locations":[{"line":1,"column":108}],"path":["createDocument"]}],"data":{"createDocument":null}} NOTE: the other functions are working normally.

    Code:

    $documents = new Documents($_ENV['AUTENTIQUE_TOKEN']);
    $folders = new Folders($_ENV['AUTENTIQUE_TOKEN']);
    $attributes = [
    		 'document' => [
    			 'name' => 'NOME DO DOCUMENTO',
    		 ],
    		 'signers' => [
    			 [
    				 'email' => '[email protected]',
    				 'action' => 'SIGN',
    				 ],
    			],
    		 'file' =>  Storage::path('teste.pdf');
    	 ];
    print_r(json_encode($documents->create($attributes)));
    

    How can i fix that?

    question 
    opened by leandrolic 4
  • Sandbox  value false.

    Sandbox value false.

    em src\Documents.php:20

    Estava assim: $this->sandbox = getenv('AUTENTIQUE_DEV_MODE') ? 'true' : 'false'; Alterei para isso: $this->sandbox = env('AUTENTIQUE_DEV_MODE') == true ? 'true' : 'false';

    Pois ele sempre estava entrando como false e dessa forma funciona.

    opened by luisrossi 4
  • [?] CRIADOCUMENTO

    [?] CRIADOCUMENTO

    AUTENTIQUE_URL=https://api.autentique.com.br/v2/graphql AUTENTIQUE_TOKEN="YOUR_TOKEN" AUTENTIQUE_DEV_MODE="true" || "false"

    opened by maxximaseguranca 1
  • Create a new document

    Create a new document

    Using createDocuments() a get a message {"message":"unauthorized"} But in the other functions i get a valid response 200

    How can i fix that?

    opened by jomaskill 1
  • [refactor] Token in constructor (Documents | Folders)

    [refactor] Token in constructor (Documents | Folders)

    Actual:

    public function __construct(string $token)
        {
            parent::__construct();
    
            $this->query = new Query($this->resourcesEnum::DOCUMENTS);
            $this->token = $token;
        }
    

    To:

    public function __construct(string $token = null)
        {
            parent::__construct();
    
            $this->query = new Query($this->resourcesEnum::DOCUMENTS);
            $this->token = $token ?? getenv("AUTENTIQUE_TOKEN");
        }
    
    invalid 
    opened by vinicinbgs 0
  • [feature/Folders] - added query folders / [develop -> master]

    [feature/Folders] - added query folders / [develop -> master]

    • Fix issues in changed classes
    • Refactor lib to improve classes
    • Better readme (unfinished)
    • Add tool husky to hook commit, then every commit will run composer test and will block commit if tests fail
    • Fixed Scruntinizer metrics
    opened by vinicinbgs 0
  • Versão atualizada e compatível com o PHP 7.1.33

    Versão atualizada e compatível com o PHP 7.1.33

    • Arquivos atualizados com a última versão da branch master;
    • Testado na versão 7.1.33 do PHP;
    • Implementada a collection folder, permitindo criar, editar e excluir diretórios;
    • Modificada a collection document, permindo mover arquivos pelos diretórios;
    • Adicionado certificado ca-bundle.crt dentro da pasta do pacote.
    opened by gotzsys 0
  • [docs] API return false

    [docs] API return false

    When you dont have a cacert.pem (Certified) configured in php.ini, its possible return false.

    How fix? Use in CURL options

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , false)
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , false)
    

    Or,

    Download latest version in https://curl.haxx.se/docs/caextract.html and configure in php.ini

    curl.cainfo="/etc/php7.0/cacert.pem"
    openssl.cafile="/etc/php7.0/cacert.pem"
    
    documentation 
    opened by vinicinbgs 0
Releases(v3.1.1)
  • v3.1.1(Nov 5, 2022)

    What's Changed

    • Novo método mover arquivo recuperado da pasta atual by @luisferreirahi in https://github.com/vinicinbgs/autentique-v2/pull/27
    • Refactor to improve Api.php class
    • Improve documentation
    • Adding PHPDoc to variable types

    New Contributors

    • @luisferreirahi made their first contribution in https://github.com/vinicinbgs/autentique-v2/pull/27

    Full Changelog: https://github.com/vinicinbgs/autentique-v2/compare/v3.0.1...v3.1.1

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Feb 7, 2022)

    We happy to announce the v3 🥳

    The package 📦 went through a refactor, so we need to release a new major version v3.0.0:

    1. Big refactor to improve all classes and remove code smells
    2. Added Folders api
    3. Changed api return from string to array when execute a query (broken compatibility with v2.0.1)
    4. Test coverage 100%
    5. Code intelligence 100%
    6. Add contribution part
    7. Add script to contribute
    8. Improve documentation
    Source code(tar.gz)
    Source code(zip)
  • 2.0.1(Jan 21, 2021)

  • v2.0.0(Oct 14, 2020)

Owner
Vinicius Morais Dutra
I'm a Software Engineer from Brazil. Passionate about technology, and how things work behind.
Vinicius Morais Dutra
Phalcon PHP REST API Package, still in beta, please submit issues or pull requests

PhREST API A Phalcon REST API package, based on Apigees guidelines as found in http://apigee.com/about/content/web-api-design Please see the skeleton

PhREST 29 Dec 27, 2022
This package makes it easy for developers to access WhatsApp Cloud API service in their PHP code.

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform

NETFLIE 135 Dec 29, 2022
微信支付 API v3 的 PHP Library,同时也支持 API v2

微信支付 WeChatPay OpenAPI SDK [A]Sync Chainable WeChatPay v2&v3's OpenAPI SDK for PHP 概览 微信支付 APIv2&APIv3 的Guzzle HttpClient封装组合, APIv2已内置请求数据签名及XML转换器,应

null 275 Jan 5, 2023
Simple PHP API client for tube-hosting.com rest API

Tube-Hosting API PHP client Explanation This PHP library is a simple api wrapper/client for the tube-hosting.com api. It is based on the provided docu

null 4 Sep 12, 2022
Chargebee API PHP Client (for API version 2 and Product Catalog version 2.0)

chargebee-php-sdk Overview This package provides an API client for Chargebee subscription management services. It connects to Chargebee REST APIs for

GLOBALIS media systems 8 Mar 8, 2022
A RESTful API package for the Laravel and Lumen frameworks.

The Dingo API package is meant to provide you, the developer, with a set of tools to help you easily and quickly build your own API. While the goal of

null 9.3k Jan 7, 2023
A Laravel Fractal package for building API responses, giving you the power of Fractal with Laravel's elegancy.

Laravel Responder is a package for building API responses, integrating Fractal into Laravel and Lumen. It can transform your data using transformers,

Alexander Tømmerås 776 Dec 25, 2022
JSON API (jsonapi.org) package for Laravel applications.

cloudcreativity/laravel-json-api Status This package has now been rewritten, substantially improved and released as the laravel-json-api/laravel packa

Cloud Creativity 753 Dec 28, 2022
This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science courses and the like.

Simple PHP API v.1.0 This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science courses a

Edson M. de Souza 14 Nov 18, 2021
This API provides functionality for creating and maintaining users to control a simple To-Do-List application. The following shows the API structure for users and tasks resources.

PHP API TO-DO-LIST v.2.0 This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science cours

Edson M. de Souza 6 Oct 13, 2022
API documentation API SCB EASY APP

SCB-API-EASY V3.0 API documentation SIAM COMMERCIAL BANK PUBLIC COMPANY LTD. API SCB Easy V3 endpoint = https://fasteasy.scbeasy.link 1.0. Get balance

SCB API Esay team 2 Sep 28, 2021
Courier API adalah project API untuk mengetahui ongkos kirim Logistik-logistik pengiriman barang antar kota & International

Courier API Courier API adalah project API untuk mengetahui ongkos kirim Logistik-logistik pengiriman barang antar kota (dalam negeri) & International

Rangga Darmajati 2 Sep 24, 2021
Laravel api tool kit is a set of tools that will help you to build a fast and well-organized API using laravel best practices.

Laravel API tool kit and best API practices Laravel api tool kit is a set of tools that will help you to build a fast and well-organized API using lar

Ahmed Esa 106 Nov 22, 2022
LaraBooks API - Simple API for iOS SwiftUI app tests.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Konrad Podrygalski 1 Nov 13, 2021
Best resources restful api for developers (with JSON:API standar specification design)

List API Best resources restful api for developers (with JSON:API standar specification design). API Resource Endpoint Name Resource Description Al Qu

Noval 2 Jan 18, 2022
GraphQL API to Studio Ghibli REST API

GhibliQL GhibliQL is a GraphQL wrapper to the Studio Ghibli REST API Usage First, you'll need a GraphQL client to query GhibliQL, like GraphQL IDE Con

Sebastien Bizet 8 Nov 5, 2022
The 1Password Connect PHP SDK provides your PHP applications access to the 1Password Connect API hosted on your infrastructure and leverage the power of 1Password Secrets Automation

1Password Connect PHP SDK The 1Password Connect PHP SDK provides your PHP applications access to the 1Password Connect API hosted on your infrastructu

Michelangelo van Dam 12 Dec 26, 2022
API for Symbiota using the Lumen PHP PHP Micro-Framework By Laravel

symbiota-api API for Symbiota using the Lumen PHP PHP Micro-Framework By Laravel Laravel Lumen Official Documentation Documentation for the Lumen fram

Biodiversity Knowledge Integration Center 2 Jan 3, 2022
A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.

Slack for PHP | A simple PHP package for sending messages to Slack with incoming webhooks, focused on ease-of-use and elegant syntax. supports: PHP 7.

null 128 Nov 28, 2022