2017 © Pedro Peláez
 

library pdffiller-php-api-client

PHP client for pdffiller.com REST API

image

pdffiller/pdffiller-php-api-client

PHP client for pdffiller.com REST API

  • Tuesday, November 14, 2017
  • by pdffiller
  • Repository
  • 16 Watchers
  • 12 Stars
  • 13,373 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 35 Versions
  • 1 % Grown

The README.md

PDFfiller PHP Client

Join the chat at https://gitter.im/pdffiller/pdffiller-php-api-client, (*1)

PDFfiller API You can sign up for the API here, (*2)

System Requirements

  • PHP >= 7.0 but the latest stable version of PHP is recommended;
  • mbstring extension;
  • intl extension;

Installation

The library is available on Packagist and can be installed using Composer. This is done by running the following command on a composer installed box:, (*3)

$ composer require pdffiller/pdffiller-php-api-client

Most modern frameworks include Composer out of the box. However, please ensure that the following file is included:, (*4)

// Include the Composer autoloader
require 'vendor/autoload.php';

Troubleshooting

If you have the following error:, (*5)

[RuntimeException]
 Could not load package pdffiller/pdffiller-php-api-client in http://packagi
 st.org: [UnexpectedValueException] Could not parse version constraint ^5.2:
  Invalid version string "^5.2"


 [UnexpectedValueException]
 Could not parse version constraint ^5.2: Invalid version string "^5.2"

Try running, (*6)

composer self-update 

Also you might encounter the following:, (*7)

Warning: require_once(../../vendor/autoload.php): failed to open stream: No such file or directory

This issue is easily fixed by installing composer dependencies:, (*8)

composer install

Quick getting started steps

Install required libraries using composer, (*9)

cd pdffiller-php-api-client/
composer install

Edit .env file in examples directory setting client_id, client_secret, username and password (for authorization via password_grant), (*10)

cd examples/ 
cp .env.example .env
vi .env

Run any example, (*11)

cd signature_request/
php 1_get_signature_request_list.php

Authentication

Access tokens automatically initialize when they’re successfully retrieved from the given user's credentials (after PDFfiller\OAuth2\Client\Provider\PDFfiller::getAccessToken($grant_type, $options) method), according to the example below:, (*12)

<?php
require_once __DIR__.'/vendor/autoload.php';

use \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' => 'pdffiller_account@example.com',
    'password' => 'some_pass'
];

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

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

When your authorization has been completed successfully you can use the provider for retrieving, creating, updating or deleting information from your profile., (*13)

Usage

Use a static method to retrieve a list of all applications: PDFfiller\OAuth2\Client\Provider\Core\Model::all(PDFfiller $provider), (*14)

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

For retrieving information about one application, call static: PDFfiller\OAuth2\Client\Provider\Core\Model::one(PDFfiller $provider, $appClientId), (*15)

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

If you want to create a new application, you must create a new Application object with the necessary information and save it using the following method: PDFfiller\OAuth2\Client\Provider\Core\Model::save(), (*16)

$application = new Application($provider);

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

If you want to update an instance, you must retrieve an Application object and save it by using the following method: PDFfiller\OAuth2\Client\Provider\Core\Model::save(), (*17)

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

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

Updating information is easy by using: PDFfiller\OAuth2\Client\Provider\Core\Model::save() method. If you wish to remove an application, use: PDFfiller\OAuth2\Client\Provider\Core\Model::remove() method, (*18)

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

All examples with other endpoints are available in the examples folder, (*19)

Support

If you have any problems feel free to contact us: * On our issues page https://github.com/pdffiller/pdffiller-php-api-client/issues * Via chat or phone at our tech site http://developers.pdffiller.com * Join our Gitter chat room for technical advice https://gitter.im/pdffiller/pdffiller-php-api-client, (*20)

License

This software is licensed under the following MIT license, (*21)

Author

API Team (integrations@pdffiller.com), (*22)

The Versions

14/11 2017

dev-feature/AC-664_add_v2_oauth_and_template_crud

dev-feature/AC-664_add_v2_oauth_and_template_crud

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

13/11 2017

dev-master

9999999-dev

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

13/11 2017

2.2.2

2.2.2.0

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

05/05 2017

2.0.x-dev

2.0.9999999.9999999-dev

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

05/05 2017

2.2.1

2.2.1.0

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

05/05 2017

2.2.0

2.2.0.0

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

22/03 2017

2.1.0

2.1.0.0

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

15/03 2017

dev-feature/API-1976-fillable-field-property-fillable

dev-feature/API-1976-fillable-field-property-fillable

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

13/03 2017

dev-feature/API-1854-fill-request-endpoints

dev-feature/API-1854-fill-request-endpoints

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

22/02 2017

2.0.1

2.0.1.0

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

17/02 2017

dev-fix/API-1852-fix-filled-form-export

dev-fix/API-1852-fix-filled-form-export

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

17/02 2017

dev-fix/API-1837-fil-losing-l2f-additional-documents

dev-fix/API-1837-fil-losing-l2f-additional-documents

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

17/02 2017

dev-fix/API-1836-add-application-fields

dev-fix/API-1836-add-application-fields

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

16/02 2017

dev-feature/API-1827-fix-fillable-fields

dev-feature/API-1827-fix-fillable-fields

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

16/02 2017

1.6.x-dev

1.6.9999999.9999999-dev

PHP client for pdffiller.com REST API

  Sources   Download

The Requires

 

The Development Requires

16/01 2017

2.0.0

2.0.0.0

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

10/01 2017

dev-feature/API-1326-add-unit-tests

dev-feature/API-1326-add-unit-tests

PHP client for pdffiller.com REST API

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest client pdffiller

06/01 2017

dev-feature/API-1510-update-readme

dev-feature/API-1510-update-readme

PHP client for pdffiller.com REST API

  Sources   Download

The Requires

 

The Development Requires

07/12 2016

dev-feature/API-1294-fix-comments

dev-feature/API-1294-fix-comments

PHP client for pdffiller.com REST API

  Sources   Download

The Requires

 

The Development Requires

06/12 2016
30/11 2016

dev-feature/API-1255-remove-internal-grant

dev-feature/API-1255-remove-internal-grant

PHP client for pdffiller.com REST API

  Sources   Download

The Requires

 

The Development Requires

04/08 2016

dev-feature/osv_api-598_replace_leage_uri

dev-feature/osv_api-598_replace_leage_uri

Simple client for pdffiller.com api

  Sources   Download

The Requires

 

The Development Requires

29/07 2016

dev-feature/osv_api-568_add_new_attr_to_document_model

dev-feature/osv_api-568_add_new_attr_to_document_model

Simple client for pdffiller.com api

  Sources   Download

The Requires

 

The Development Requires