signnow / api-php-sdk
Library to communicate with SignNow API
Installs: 105 137
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 5
Forks: 11
Open Issues: 10
pkg:composer/signnow/api-php-sdk
Requires
- php: ^8.2
 - ext-json: *
 - guzzlehttp/guzzle: ^7.8.0
 - symfony/dependency-injection: ^7.0
 - symfony/property-access: ^7.0
 - symfony/serializer: ^7.0
 
Requires (Dev)
- fakerphp/faker: ^1.23
 - mcustiel/phiremock-server: ^1.2
 - squizlabs/php_codesniffer: ^3.7
 
- dev-master
 - v3.5.0
 - v3.4.1
 - v3.4.0
 - v3.3.1
 - v3.3.0
 - v3.2.2
 - v3.2.1
 - v3.2.0
 - v3.1.0
 - v3.0.1
 - v3.0.0
 - 2.x-dev
 - v2.2.9
 - v2.2.8
 - v2.2.7
 - v2.2.6
 - v2.2.5
 - v2.2.4
 - v2.2.3
 - v2.2.2
 - v2.2.1
 - v2.2.0
 - v2.1.0
 - v2.0.0
 - 1.x-dev
 - v1.5.9
 - v1.5.8
 - v1.5.7
 - v1.5.6
 - v1.5.5
 - v1.5.4
 - v1.5.3
 - v1.5.2
 - v1.5.1
 - v1.5.0
 - v1.4.0
 - v1.3.0
 - v1.2.0
 - v1.1.0
 - v1.0.1
 - v1.0.0
 - dev-v.3.3
 
This package is not auto-updated.
Last update: 2025-10-29 15:38:38 UTC
README
v3.5.0
Requirements
- PHP 8.2 or higher
 - composer
 - cURL extension
 
Installation
Get SDK code via composer
composer require signnow/api-php-sdk:v3
or via git
git clone git@github.com:signnow/SignNowPHPSDK.git
Install dependencies
make install
Configuration
Copy .env.example to .env and fill your credentials in the required values
cp .env.example .env
Run tests
To run tests you need to have a valid .env.test file with credentials for testing.
If you don't have it, you can create it by copying the .env.test.dist file and renaming it to .env.test.
However, the file will be created automatically if you just run test execution with the following commands:
## Run mock server locally make mock-up ## Run all the tests make tests ## Run a single test by specified argument make test T=Document/DocumentTest.php
Mock server will be available at http://0.0.0.0:8086.
Usage
To start using the SDK, you need to create a new instance of the SDK API client and authenticate it using the credentials from the .env file.
require_once __DIR__ . '/vendor/autoload.php'; use SignNow\ApiClient; use SignNow\Api\Document\Request\DocumentGet; use SignNow\Exception\SignNowApiException; use SignNow\Sdk; $sdk = new Sdk(); try { // Method authenticate() will use the credentials from the .env file // and create a new bearer token for further requests $apiClient = $sdk->build() ->authenticate() ->getApiClient(); // Now, you are ready to use the API client to send requests // if you want to keep the token, you can use the following code $bearerToken = $sdk->actualBearerToken(); // or $bearerToken = $apiClient->getBearerToken(); } catch (SignNowApiException $e) { echo $e->getMessage(); }
If you have already received a bearer token and wish to reuse it, then the following API client initialization scheme will be useful:
require_once __DIR__ . '/vendor/autoload.php'; use SignNow\ApiClient; use SignNow\Api\Document\Request\DocumentGet; use SignNow\Core\Token\BearerToken; use SignNow\Exception\SignNowApiException; use SignNow\Sdk; $sdk = new Sdk(); try { $token = 'YOUR_TOKEN_HERE'; $apiClient = $sdk->build() ->withBearerToken(new BearerToken($token, '', 0)) ->getApiClient(); // Now, you are ready to use the API client to send requests } catch (SignNowApiException $e) { echo $e->getMessage(); }
Example of sending a request to get a document by id:
require_once __DIR__ . '/vendor/autoload.php'; use SignNow\ApiClient; use SignNow\Api\Document\Request\DocumentGet; use SignNow\Exception\SignNowApiException; use SignNow\Sdk; $sdk = new Sdk(); try { // Instantiate the API client $apiClient = $sdk->build() ->authenticate() ->getApiClient(); // Prepare a request to get a document by id $documentId = 'e896ec9311a74a8a8ee9faff7049446fe452e461'; $request = new DocumentGet(); $request->withDocumentId($documentId); // Send the request and get the response $response = $apiClient->send($request); } catch (SignNowApiException $e) { echo $e->getMessage(); }
Examples
You can find more examples of API usage in the examples directory.