PHP code example of signdocs-brasil / signdocs-brasil-php
1. Go to this page and download the library: Download signdocs-brasil/signdocs-brasil-php 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/ */
signdocs-brasil / signdocs-brasil-php example snippets
use SignDocsBrasil\Api\SignDocsBrasilClient;
use SignDocsBrasil\Api\Config;
use SignDocsBrasil\Api\Models\CreateTransactionRequest;
use SignDocsBrasil\Api\Models\Policy;
use SignDocsBrasil\Api\Models\Signer;
$client = new SignDocsBrasilClient(new Config(
clientId: 'seu_client_id',
clientSecret: 'seu_client_secret',
));
$tx = $client->transactions->create(new CreateTransactionRequest(
purpose: 'DOCUMENT_SIGNATURE',
policy: new Policy(profile: 'CLICK_ONLY'),
signer: new Signer(
name: 'João Silva',
email: '[email protected]',
userExternalId: 'user-001',
),
document: ['content' => $pdfBase64, 'filename' => 'contrato.pdf'],
));
echo $tx->transactionId . ' ' . $tx->status;