PHP code example of omnisign / docuseal

1. Go to this page and download the library: Download omnisign/docuseal 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/ */

    

omnisign / docuseal example snippets


use Omnisign\Docuseal\DocusealGatewayFactory;

$gateway = (new DocusealGatewayFactory($httpClient))->create(['url' => 'https://sign.example.org/api', 'api_key' => getenv('DOCUSEAL_API_KEY')]);

$envelope = $gateway->create(new Envelope('Bail', signers: [$tenant], embedded: true, template: '12'));
$gateway->signingUrl($envelope, 'tenant')->url;           // https://sign.example.org/s/<slug>
$gateway->download($gateway->fetch($envelope));           // the signed PDF and the audit log, once completed