PHP code example of dropbox / sign

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

    

dropbox / sign example snippets




namespace Dropbox\SignSandbox;

fig = Dropbox\Sign\Configuration::getDefaultConfiguration();
$config->setUsername("YOUR_API_KEY");
// $config->setAccessToken("YOUR_ACCESS_TOKEN");

$account_create_request = (new Dropbox\Sign\Model\AccountCreateRequest())
    ->setEmailAddress("[email protected]");

try {
    $response = (new Dropbox\Sign\Api\AccountApi(config: $config))->accountCreate(
        account_create_request: $account_create_request,
    );

    print_r($response);
} catch (Dropbox\Sign\ApiException $e) {
    echo "Exception when calling AccountApi#accountCreate: {$e->getMessage()}";
}




ig = Dropbox\Sign\Configuration::getDefaultConfiguration();
$config->setUsername("YOUR_API_KEY");

$api = new Dropbox\Sign\Api\SignatureRequestApi($config);

$data = Dropbox\Sign\Model\SignatureRequestSendRequest::init([
    "title"   => "NDA with Acme Co.",
    "signers" => [
        [
            "email_address" => "[email protected]",
            "name"          => "Jack",
            "order"         => 0,
        ],
        [
            "email_address" => "[email protected]",
            "name"          => "Jill",
            "order"         => 1,
        ],
    ],
    "files"    => [
        new SplFileObject("/absolute/path/to/file.pdf"),
    ],
]);

try {
    $result = $api->signatureRequestSend($data);
    print_r($result);
} catch (Dropbox\Sign\ApiException $e) {
    echo "Exception when calling Dropbox Sign API: "
        . $e->getMessage() . PHP_EOL;
}