marshmallow/signrequest-client

Official PHP client for SignRequest.com (https://signrequest.com)

Maintainers

Package info

github.com/marshmallow-packages/signrequest-php-client

Homepage

pkg:composer/marshmallow/signrequest-client

Statistics

Installs: 40 645

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

1.0.0 2021-07-13 11:54 UTC

This package is auto-updated.

Last update: 2026-06-11 15:54:38 UTC


README

marshmallow.

SignRequest PHP Client

Latest Version on Packagist Total Downloads License

Official PHP client for SignRequest.com — send documents for digital signing, manage templates, teams and webhooks through the SignRequest REST API.

Why this fork? This is a published fork of SignRequest/signrequest-php-client, republished so it can be installed on PHP 8+ projects. We opened a pull request against the original package but couldn't wait for it to be processed. Once the upstream package supports PHP 8+, this fork will be removed.

This is a plain PHP SDK generated with Swagger Codegen on top of Guzzle. It is framework-agnostic — there is no Laravel service provider, config publishing or facade.

Requirements

  • PHP ^7.2.5 || ^8.0
  • Extensions: ext-curl, ext-json, ext-mbstring
  • guzzlehttp/guzzle ^7.3

Installation

Install the package via Composer:

composer require marshmallow/signrequest-client

The package is autoloaded under the SignRequest\ namespace (PSR-4). If you are not using Composer's autoloader yet, require it:

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

Authentication

All requests are authenticated with a SignRequest API token, sent as an Authorization: Token <your-api-key> header. You can find your token in your SignRequest account settings.

Configure it once on the shared Configuration instance:

$config = SignRequest\Configuration::getDefaultConfiguration()
    ->setApiKey('Authorization', 'YOUR_API_KEY')
    ->setApiKeyPrefix('Authorization', 'Token');

The default API base URL is https://signrequest.com/api/v1. You can override it with $config->setHost('https://...') if needed.

Usage

Each resource has its own API class under SignRequest\Api. Instantiate it with a Guzzle client and your configured Configuration, then call the typed methods. Example — creating a document:

<?php

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

// Configure API key authorization: Token
$config = SignRequest\Configuration::getDefaultConfiguration()
    ->setApiKey('Authorization', 'YOUR_API_KEY')
    ->setApiKeyPrefix('Authorization', 'Token');

$apiInstance = new SignRequest\Api\DocumentsApi(
    // If omitted, a default GuzzleHttp\Client is used.
    new GuzzleHttp\Client(),
    $config
);

$data = new \SignRequest\Model\Document();
// ...populate $data...

try {
    $result = $apiInstance->documentsCreate($data);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DocumentsApi->documentsCreate: ', $e->getMessage(), PHP_EOL;
}

Every API method also has an asynchronous counterpart (e.g. documentsCreateAsync()) returning a Guzzle promise.

Available API classes

All classes live in the SignRequest\Api namespace. See the linked docs for every method, parameter and return type.

API class Description Docs
ApiTokensApi Manage API tokens docs
DocumentsApi Create, read, list and delete documents docs
DocumentAttachmentsApi Manage document attachments docs
DocumentsSearchApi Search documents docs
EventsApi Read account events docs
SignrequestsApi Send and manage sign requests docs
SignrequestQuickCreateApi Create a sign request in one call docs
TemplatesApi Manage templates docs
TeamsApi Manage teams docs
TeamMembersApi Manage team members docs
WebhooksApi Manage webhooks docs

Request/response models live in the SignRequest\Model namespace and are documented under docs/Model.

Documentation

Testing

composer install
./vendor/bin/phpunit

Credits

License

The MIT License (MIT). Please see the License File for more information.