PHP code example of pdffiller / pdffiller-php-api-client

1. Go to this page and download the library: Download pdffiller/pdffiller-php-api-client 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/ */

    

pdffiller / pdffiller-php-api-client example snippets


// Include the Composer autoloader


\PDFfiller\OAuth2\Client\Provider\Enums\GrantType;
use \PDFfiller\OAuth2\Client\Provider\PDFfiller;

$oauthParams = [
    'clientId'       => 'YOUR_CLIENT_ID',
    'clientSecret'   => 'YOUR_CLIENT_SECRET',
    'urlAccessToken' => 'https://api.pdffiller.com/v2/oauth/token',
    'urlApiDomain'   => 'https://api.pdffiller.com/v2/'
];

$passwordGrantCredentials = [
    'username' => '[email protected]',
    'password' => 'some_pass'
];

/** @var \PDFfiller\OAuth2\Client\Provider\PDFfiller $provider */
$provider = new PDFfiller($oauthParams);

$accessToken = $provider->getAccessToken(GrantType::PASSWORD_GRANT, $passwordGrantCredentials);
print_r($accessToken);

$list = Application::all($provider);
print_r($list);

$application = Application::one($provider, 'app_client_id');
print_r($application);

$application = new Application($provider);

$application->name = 'App name';
$application->description = 'Some application description';
$application->domain = 'http://some.domain.com';
print_r($application->save());

$application = Application::one($provider, 'app_client_id');

$application->name = 'Updated App name';
$application->description = 'Some changed application description';
$result = $application->save();
print_r($result);

$application = Application::one($provider, 'app_client_id');
$result = $application->remove();
print_r($result);

$ composer 

cd pdffiller-php-api-client/
composer install

cd signature_request/
php 1_get_signature_request_list.php