PHPackages                             hellosign/hellosign-php-sdk - 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. [API Development](/categories/api)
4. /
5. hellosign/hellosign-php-sdk

AbandonedArchivedLibrary[API Development](/categories/api)

hellosign/hellosign-php-sdk
===========================

This is the official PHP wrapper for HelloSign's API

3.8.0(3y ago)983.4M↑18.5%38[12 issues](https://github.com/hellosign/hellosign-php-sdk/issues)1MITPHPPHP ^8.0|8.1

Since May 7Pushed 2y ago28 watchersCompare

[ Source](https://github.com/hellosign/hellosign-php-sdk)[ Packagist](https://packagist.org/packages/hellosign/hellosign-php-sdk)[ RSS](/packages/hellosign-hellosign-php-sdk/feed)WikiDiscussions v3 Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (80)Used By (1)

⚠ This SDK has been deprecated ⚠
================================

[](#-this-sdk-has-been-deprecated-)

This SDK is now deprecated and will no longer receive feature updates or bug fixes. Security fixes will still be applied as needed.

The new `dropbox/sign` SDK can be found at [hellosign/dropbox-sign-php](https://github.com/hellosign/dropbox-sign-php)!

The new SDK and this legacy SDK are *not* backwards-compatible!

Please [see here for a comprehensive migration guide](https://developers.hellosign.com/docs/sdks/php/migration-guide/).

---

HelloSign PHP SDK
-----------------

[](#hellosign-php-sdk)

[![Build Status](https://camo.githubusercontent.com/87915f6e123b35c30d04b5b80da3ce5ff7f9398dd1ac95a142df0c39f834590c/68747470733a2f2f7472617669732d63692e6f72672f68656c6c6f7369676e2f68656c6c6f7369676e2d7068702d73646b2e7376673f6272616e63683d7633)](https://travis-ci.org/hellosign/hellosign-php-sdk)

This is the official PHP SDK for HelloSign's API. [View API Documentation and Examples.](https://app.hellosign.com/api/documentation)

Installation
------------

[](#installation)

### Requirements

[](#requirements)

The latest version of the SDK requires PHP version 8.0 or higher. For PHP 7.x use SDK version 3.7.\*

You can import this SDK into your library two ways, either through including the base HelloSign.php file into your project or using [Composer](https://getcomposer.org/doc/00-intro.md).

To use Composer:

- First, install Composer if you don't have it already

    ```
    curl -sS https://getcomposer.org/installer | php
    ```
- Create a `composer.json` file and add the following:

    ```
    {
        "require": {
            "hellosign/hellosign-php-sdk": "^3.0"
        }
    }
    ```
- Install `hellosign-php-sdk` package via Composer

    ```
    php composer.phar install
    ```
- Include the library in your script

    ```
    require_once 'vendor/autoload.php';
    ```
- See below for how to configure your Client class.

Configuration
-------------

[](#configuration)

All HelloSign API requests can be made using the `HelloSign\Client` class. This class must be initialized with your authentication details such as an API key (preferred), email/password combo, or OAuth credentials.

### API key Config

[](#api-key-config)

```
$client = new HelloSign\Client($apikey);
```

### Email/Password Config

[](#emailpassword-config)

```
$client = new HelloSign\Client($email_address, $password);
```

### Oauth Config

[](#oauth-config)

```
$client = new HelloSign\Client($oauth_token); //instance of HelloSign\OAuthToken
```

Your app users are almost ready to start signing! See below for the most common use cases for this wrapper.

Usage
-----

[](#usage)

You can test your authentication by calling

```
$account = $client->getAccount();
```

### Retrieving fields returned from the API

[](#retrieving-fields-returned-from-the-api)

Using magic methods

```
$signature_request->title;
```

Or if you want to get all attributes in an array

```
$signature_request->toArray();
```

### Creating a Signature Request

[](#creating-a-signature-request)

```
$request = new HelloSign\SignatureRequest;
$request->enableTestMode();
$request->setTitle('NDA with Acme Co.');
$request->setSubject('The NDA we talked about');
$request->setMessage('Please sign this NDA and let\'s discuss.');
$request->addSigner('jack@example.com', 'Jack');
$request->addSigner('jill@example.com', 'Jill');
$request->addCC('lawyer@example.com');
$request->addFile('nda.pdf'); //Adding file from local

$response = $client->sendSignatureRequest($request);
```

To specify a URL to a remote file instead use:

```
$request->addFileURL('PUBLIC_URL_TO_YOUR_FILE');
```

If you are using Text Tags in your document, you can enable and configure them through the respective methods:

```
$request->setUseTextTags(true);
$request->setHideTextTags(true);
```

Or if you want to set Form Fields per Document:

```
$request->setFormFieldsPerDocument(
            array(
                array( //document 1
                    array( //field 1
                        "api_id"=> $random_prefix . "_1",
                        "name"=> "",
                        "type"=> "text",
                        "x"=> 112,
                        "y"=> 328,
                        "width"=> 100,
                        "height"=> 16,
                        "required"=> true,
                        "signer"=> 0
                    ),
                    array( //field 2
                        "api_id"=> $random_prefix . "_2",
                        "name"=> "",
                        "type"=> "signature",
                        "x"=> 530,
                        "y"=> 415,
                        "width"=> 150,
                        "height"=> 30,
                        "required"=> true,
                        "signer"=> 1
                    ),
                ),
            )
        );
```

### Retrieving a User's Templates

[](#retrieving-a-users-templates)

The HelloSign API provides paged lists for user templates and signature requests. These lists are represented as objects that can be iterated upon.

```
$templates = $client->getTemplates($page_number);
foreach ($templates as $template) {
    echo $template->getTitle() . "\n";
}
```

### Creating a Signature Request from a Template

[](#creating-a-signature-request-from-a-template)

```
$request = new HelloSign\TemplateSignatureRequest;
$request->enableTestMode();
$request->setTemplateId($template->getId());
$request->setSubject('Purchase Order');
$request->setMessage('Glad we could come to an agreement.');
$request->setSigner('Client', 'george@example.com', 'George');
$request->setCC('Accounting', 'accounting@example.com');
$request->setCustomFieldValue('Cost', '$20,000');

$response = $client->sendTemplateSignatureRequest($request);
```

### Checking the Status of a Signature Request

[](#checking-the-status-of-a-signature-request)

```
$response = $client->getSignatureRequest($signature_request_id);
if ($response->isComplete()) {
    echo 'All signers have signed this request.';
} else {
    foreach ($response->getSignatures() as $signature) {
        echo $signature->getStatusCode() . "\n";
    }
}
```

### Creating an Embedded Signature Request to use for Embedded Signing

[](#creating-an-embedded-signature-request-to-use-for-embedded-signing)

Refer to the (Embedded Signing Walkthrough)\[\] for more details.

```
// Create the SignatureRequest or TemplateSignatureRequest object
$request = ...

// Turn it into an embedded request
$embedded_request = new HelloSign\EmbeddedSignatureRequest($request, $client_id);

// Send it to HelloSign
$response = $client->createEmbeddedSignatureRequest($embedded_request);

// Grab the signature ID for the signature page that will be embedded in the
// page (for the demo, we'll just use the first one)
$signatures   = $response->getSignatures();
$signature_id = $signatures[0]->getId();

// Retrieve the URL to sign the document
$response = $client->getEmbeddedSignUrl($signature_id);

// Store it to use with the embedded.js HelloSign.open() call
$sign_url = $response->getSignUrl();
```

### Creating an Embedded Template draft

[](#creating-an-embedded-template-draft)

```
$template = new HelloSign\Template();
$template->enableTestMode();
$template->setClientId($client_id);
$template->addFile('nda.pdf');
$template->setTitle('Test Title');
$template->setSubject('Test Subject');
$template->setMessage('Test Message');
$template->addSignerRole('Test Role');
$template->addMetadata('custom_id', '1234');

$response = $client->createEmbeddedDraft($template);
```

### Creating an Unclaimed Draft to use for Embedded Requesting

[](#creating-an-unclaimed-draft-to-use-for-embedded-requesting)

```
$draft = new HelloSign\UnclaimedDraft($request, $client_id);
// optionally change it to a self-signing draft with $draft->setType("send_document");
$response = $client->createUnclaimedDraft($draft);

// Store it to use with the embedded.js HelloSign.open() call
$sign_url = $response->getClaimUrl();
```

### Enabling OAuth

[](#enabling-oauth)

```
// If the account does not exist
if !($client->isAccountValid($email)) {
    // Create new account
    $account = $client->createAccount(
        new HelloSign\Account($email),
        $client_id,
        $client_secret
    );

    // Get OAuth token
    $token = $account->getOAuthData();
} else {
    // Create the OAuthTokenRequest object
    $oauth_request = new HelloSign\OAuthTokenRequest(array(
        'code'          => $code,
        'state'         => $state,
        'client_id'     => $client_id,
        'client_secret' => $client_secret
    ));

    // Request OAuth token for the first time
    $token = $client->requestOAuthToken($oauth_request);
}

// Export token to array, store it to use later
$hellosign_oauth = $token->toArray();

// Populate token from array
$token = new HelloSign\OAuthToken($hellosign_oauth);

// Refresh token if it expired
$client->refreshOAuthToken($token);

// Provide the user's OAuth access token to the client
$client = new HelloSign\Client($token);
```

Displaying warnings
-------------------

[](#displaying-warnings)

Any warnings returned from the API can be accessed via the returned object / list via the getWarnings method:

```
  $response = $this->client->getSignatureRequests();
  print_r($response->getWarnings());
```

Testing
-------

[](#testing)

This project contains PHPUnit tests that check the SDK code and can also be referenced for examples. Most are functional and integrated tests that walk through real user scenarios.

In order to pass the unit tests, you will need:

1. The API Key for a confirmed HelloSign account
2. The client ID and secret key from a confirmed HelloSign API App
3. A HelloSign subscription (to create a team)
4. A HelloSign API subscription (to access paid API endpoints)
5. A template with 1 signer role named 'Signer'
6. A Team with 1 additional team member

\*\*\* WARNING: these tests will add and remove users from your team. Use with caution.

### To run the tests

[](#to-run-the-tests)

- Copy file `phpunit.xml.dist` to `phpunit.xml`
- Edit the new file and enter your values for `API_KEY`, `CLIENT_ID`, `CLIENT_SECRET`, `CALLBACK_URL`, `API_URL`, AND `OAUTH_TOKEN_URL`
- Run `./vendor/bin/phpunit`

License
-------

[](#license)

```
The MIT License (MIT)

Copyright (C) 2014 hellosign.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

```

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity58

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 58.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~70 days

Total

68

Last Release

1197d ago

Major Versions

v3.7.0 → v6.0.0-beta12022-03-21

PHP version history (2 changes)v6.0.0-beta1PHP ^7.3 || ^8.0

3.8.0PHP ^8.0|8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/710f3956ca5131e0021ededaf97d2a15f204a456ee993d3db66b71a56a404f1f?d=identicon)[hellosign](/maintainers/hellosign)

---

Top Contributors

[![jyoung488](https://avatars.githubusercontent.com/u/20921525?v=4)](https://github.com/jyoung488 "jyoung488 (134 commits)")[![BHSPitMonkey](https://avatars.githubusercontent.com/u/33672?v=4)](https://github.com/BHSPitMonkey "BHSPitMonkey (18 commits)")[![hellofaxsteve](https://avatars.githubusercontent.com/u/6990951?v=4)](https://github.com/hellofaxsteve "hellofaxsteve (15 commits)")[![algorozco](https://avatars.githubusercontent.com/u/45442898?v=4)](https://github.com/algorozco "algorozco (14 commits)")[![radhack](https://avatars.githubusercontent.com/u/11508536?v=4)](https://github.com/radhack "radhack (13 commits)")[![desmondw](https://avatars.githubusercontent.com/u/1052705?v=4)](https://github.com/desmondw "desmondw (7 commits)")[![garnold](https://avatars.githubusercontent.com/u/83754?v=4)](https://github.com/garnold "garnold (5 commits)")[![jspaetzel](https://avatars.githubusercontent.com/u/828108?v=4)](https://github.com/jspaetzel "jspaetzel (3 commits)")[![jtreminio-dropbox](https://avatars.githubusercontent.com/u/50673996?v=4)](https://github.com/jtreminio-dropbox "jtreminio-dropbox (2 commits)")[![michaelnlindsay](https://avatars.githubusercontent.com/u/7490592?v=4)](https://github.com/michaelnlindsay "michaelnlindsay (2 commits)")[![mtanjung](https://avatars.githubusercontent.com/u/12073300?v=4)](https://github.com/mtanjung "mtanjung (2 commits)")[![nathanbuchar](https://avatars.githubusercontent.com/u/1815367?v=4)](https://github.com/nathanbuchar "nathanbuchar (2 commits)")[![ericbecking](https://avatars.githubusercontent.com/u/492465?v=4)](https://github.com/ericbecking "ericbecking (2 commits)")[![sgough](https://avatars.githubusercontent.com/u/1238797?v=4)](https://github.com/sgough "sgough (1 commits)")[![asolberg](https://avatars.githubusercontent.com/u/1329001?v=4)](https://github.com/asolberg "asolberg (1 commits)")[![bradmanning](https://avatars.githubusercontent.com/u/19538583?v=4)](https://github.com/bradmanning "bradmanning (1 commits)")[![Bukashk0zzz](https://avatars.githubusercontent.com/u/1908342?v=4)](https://github.com/Bukashk0zzz "Bukashk0zzz (1 commits)")[![ilamp](https://avatars.githubusercontent.com/u/12907744?v=4)](https://github.com/ilamp "ilamp (1 commits)")[![martinytodorov](https://avatars.githubusercontent.com/u/5895193?v=4)](https://github.com/martinytodorov "martinytodorov (1 commits)")[![nealfax](https://avatars.githubusercontent.com/u/584905?v=4)](https://github.com/nealfax "nealfax (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hellosign-hellosign-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/hellosign-hellosign-php-sdk/health.svg)](https://phpackages.com/packages/hellosign-hellosign-php-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
