PHP code example of forward-force / right-signature-api-sdk

1. Go to this page and download the library: Download forward-force/right-signature-api-sdk 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/ */

    

forward-force / right-signature-api-sdk example snippets


$rightSignature = new RightSignature($token);

try {
    $documents = $rightSignature->documents()->fetch();
    var_dump($documents);
} catch (GuzzleException $e) {
    var_dump($e->getMessage());
}

$document = $rightSignature->documents()->getById('fcc2517e-c596-4d91-9f59-112a292eb643');

$signer1 = ['name' => 'buyer_signer', 'signer_email' => '[email protected]', 'signer_name' => 'John Doe'];
$signer2 = ['name' => 'seller_signer', 'signer_email' => '[email protected]', 'signer_name' => 'Jane Smith'];

$document = $rightSignature->documents()
    ->addBodyParameter('roles', [$signer1, $signer2])
    ->addBodyParameter('reusable_template', [
        'roles' => [$signer1, $signer2]
    ])
    ->addBodyParameter("message", "Please sign this")
    ->addBodyParameter('name', 'Name 1')
    ->addMergeField('client_name', 'The Client')
    ->sendDocument('fcc2517e-c596-4d91-9f59-112a292eb643');

try {
    $documents = $rightSignature->documents()->fetchReusableTemplates();
    var_dump($documents);
} catch (GuzzleException $e) {
    var_dump($e->getMessage());
}

$document = $rightSignature->documents()->getReusableTemplateById('fcc2517e-c596-4d91-9f59-112a292eb643');

$rightSignature = new RightSignature($token); //pv_deec47538d80245234a66e1d14d38be81