forward-force / right-signature-api-sdk
PHP Wrapper around RightSignature API
Installs: 6 177
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.0.1
Requires (Dev)
- phpmd/phpmd: ^2.9
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.5
This package is auto-updated.
Last update: 2024-10-29 00:17:47 UTC
README
Installation
Install via composer as follows:
composer require forward-force/rightSignature-api-sdk
Usage
Authentication
In order to authenticate, you need to pass the PRIVATE API TOKEN like so:
$rightSignature = new RightSignature($token); //pv_deec47538d80245234a66e1d14d38be81
Examples
Fetch all documents:
$rightSignature = new RightSignature($token); try { $documents = $rightSignature->documents()->fetch(); var_dump($documents); } catch (GuzzleException $e) { var_dump($e->getMessage()); }
Get document by id:
$document = $rightSignature->documents()->getById('fcc2517e-c596-4d91-9f59-112a292eb643');
Clone template, prepare template (populate merge fields), and send off to signers:
$signer1 = ['name' => 'buyer_signer', 'signer_email' => 'foo@example.com', 'signer_name' => 'John Doe']; $signer2 = ['name' => 'seller_signer', 'signer_email' => 'bar@example.com', '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');
Get all reusable templates:
try { $documents = $rightSignature->documents()->fetchReusableTemplates(); var_dump($documents); } catch (GuzzleException $e) { var_dump($e->getMessage()); }
Get reusable template by id
$document = $rightSignature->documents()->getReusableTemplateById('fcc2517e-c596-4d91-9f59-112a292eb643');
Contributions
To run locally, you can use the docker container provided here. You can run it like so:
docker-compose up
There is auto-generated documentation as to how to run this library on local, please take a look at phpdocker/README.md
If you find an issue, have a question, or a suggestion, please don't hesitate to open a github issue.
Acknowledgments
Thank you to phpdocker.io for making getting PHP environments effortless!