PHPackages                             matthewpoer/php-docusign-wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. matthewpoer/php-docusign-wrapper

ActiveLibrary[Testing &amp; Quality](/categories/testing)

matthewpoer/php-docusign-wrapper
================================

A PHP wrapper for the RESTful DocuSign v2 API

056PHP

Since Oct 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/matthewpoer/php-docusign-wrapper)[ Packagist](https://packagist.org/packages/matthewpoer/php-docusign-wrapper)[ RSS](/packages/matthewpoer-php-docusign-wrapper/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-docusign-wrapper
====================

[](#php-docusign-wrapper)

DocuSign offers a reliable and RESTful (although somewhat confusingly architected) v2 API. However, I found that the [official PHP SDK](https://github.com/docusign/docusign-php-client) to just *not work* out of the box. Tried with a few different versions of PHP, tried a few hosts. There are bugs with the namespaces and/or file/class structure. Or something. But the REST API was simple enough that it would be less work to work on a new wrapper than debug theirs.

This codebase will implement basic Auth., interaction with envelopes, recipients, forms and related data. My business goal is to organize the data returned via such forms. Methods outside of this goal will likely not be implemented, but if you want to enhance and share your work back feel free to throw up a pull request.

Using Pest for REST
-------------------

[](#using-pest-for-rest)

[Pest](https://github.com/educoder/pest) is a PHP client library for RESTful web services. I found it to be a minimal and effective back-bone for PhpDocuSignWrapper. The Pest dependency is handled by composer.

Thanks @Educoder!

PHP 5.6 and Vagrant and DevBox
------------------------------

[](#php-56-and-vagrant-and-devbox)

I chose to support 5.6 because it's still a valid and highly used option in production for a lot of the industry. If you're running the latest PHP 7, the 5.6 code will still function 100%.

I've found that the [DevBox Project by Damian Lewis ](https://github.com/damianlewis/devbox) is a great dev. environment for PHP development like this. A nice `Vagrantfile` might consist of

```
Vagrant.configure("2") do |config|
  config.vm.box = "damianlewis/ubuntu-16.04-lamp"
  config.vm.provision "shell",
    inline: 'update-alternatives --set php "/usr/bin/php5.6" > /dev/null'
end

```

Thanks, @Damian!

Composer Install
----------------

[](#composer-install)

```
composer require matthewpoer/php-docusign-wrapper:dev-master

```

Authentication
--------------

[](#authentication)

While OAuth is supported by the DocuSign API, it's not implemented here. Instead we're using the [Legacy Header Authentication login method](https://developers.docusign.com/esign-rest-api/reference/Authentication/Authentication/login). Sorry about that.

### API Password

[](#api-password)

DocuSign does offer a solution to the cleartext password issue inherent here, and that is by providing us with an what the documentation calls the "apiPassword,"

> a token that can be used for authentication in API calls instead of using the user name and password

Okay, great. A Bash script is included here to get this API Password from DocuSign, just like this:

```
$ ./GetApiPassword.sh
Host? enter a subdomain, i.e. 'demo' or 'www'
www
Username:
user@host.tld
Password:
Integrator Key:
my-integrator-key
requesting API Password...
API Password Found:
"apiPassword": "Your Cool API Password"

```

Sample Code
-----------

[](#sample-code)

```
