PHPackages                             veraandco/zoho-sign-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. veraandco/zoho-sign-php-sdk

ActiveLibrary[API Development](/categories/api)

veraandco/zoho-sign-php-sdk
===========================

Zoho Sign v1 API PHP Wrapper - PHP 7.4 Ready

0.0.2.1(3y ago)21.5k1PHPPHP &gt;=7.4

Since Nov 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/neo3k/zoho-sign-php-sdk)[ Packagist](https://packagist.org/packages/veraandco/zoho-sign-php-sdk)[ Docs](https://zoho.com.sign)[ RSS](/packages/veraandco-zoho-sign-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

PHP SDK for Zoho Sign (&gt;= PHP 7.4)
-------------------------------------

[](#php-sdk-for-zoho-sign--php-74)

This SDK provides wrapper functions for Zoho Sign v1 API's Document Management and Template Management.

You can setup signing workflows using this SDK similar as in Zoho Sign UI.

Links : [Zoho Sign API Guide](https://www.zoho.com/sign/api/getting-started-guide/overview.html)&amp; [Zoho Sign API Documentation](https://www.zoho.com/sign/api/)

Credits:

- [Boris Vera](https://veraand.co)
- [Zoho](https://www.zoho.com/)

Environment Set Up
------------------

[](#environment-set-up)

PHP SDK is installable through `composer`. Composer is a tool for dependency management in PHP. SDK expects the following from the client app.

```
NOTE :
- Client app must have PHP 7.4 or above with  curl extension enabled.
- SDK must be installed into client app though composer

```

Installation of SDK through composer
------------------------------------

[](#installation-of-sdk-through-composer)

Install Composer(if not installed) Run this command to install the composer

> curl -sS  | php

To make the composer accessible globally, follow the instructions from the link below

To install composer on mac/ linux machine:

>

To install composer on windows machine:

>

Install PHP SDK
---------------

[](#install-php-sdk)

Install PHP SDK Here's how you install the SDK:

1. Navigate to the workspace of your client app
2. Run the command below:

> composer require zoho-sign/php-sdk

Hence, the PHP SDK would be installed and a package named 'vendor' would be created in the workspace of your client app.

Registering a Zoho Client
-------------------------

[](#registering-a-zoho-client)

Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:

1. Visit this page .
2. Click on `Add Client ID`.
3. Enter Client Name, Client Domain and Redirect URI then click `Create`.
4. Your Client app would have been created and displayed by now.
5. The newly registered app's Client ID and Client Secret can be found by clicking `Options` → `Edit`. (Options is the three dot icon at the right corner).

Initializing SDK
----------------

[](#initializing-sdk)

To import the classes used in SDK, use 'require\_once' to include the 'autoload.php' created by composer

> require 'vendor/autoload.php'

It is required to set the OAuth2 credentials of an user as the current user as a first step.

```
    $user = new OAuth( array(
        OAuth::CLIENT_ID => "",
        OAuth::CLIENT_SECRET => "",
        OAuth::DC => "COM", // allowed values : com/COM, in/IN, au/AU, eu/EU
        OAuth::REFRESH_TOKEN => "",
        OAuth::ACCESS_TOKEN => "" // optional. If not set, will auto refresh for access token
    ) );
    ZohoSign::setCurrentUser( $user );
```

All subsequent api calls made will be made on behalf of this user The First time user permission authenticion/approval is to handled and the oauth credential storage has to be manually handled.

You can refresh &amp; store the access\_token as

```
 $user->generateAccessTokenUsingRefreshToken();
```

Note : The OAuth credentials needs to storage(DB or file) needs to be logically handled manually

Class Heirarchy
---------------

[](#class-heirarchy)

- ZohoSign
- Oauth
- ApiClient
- SignException
- SignUtil
    - Actions
    - DocumentFormData
    - Documents
    - Fields
        - AttachmentField
        - CheckBox
        - DateField
        - DropdownField
        - DropdownValues
        - ImageField
        - RadioField
        - TextField
        - TextProperty
    - RequestType
    - TemplateDocumentFields
    - TemplateObject

SDK functions description
-------------------------

[](#sdk-functions-description)

All functions for Document and Template management are available under 'ZohoSign.php' class

#### Document Management functions

[](#document-management-functions)

```
 getRequest()
    Params: [INT] request_id
    Return: instance of RequestObject
    Throws: SignException
    Description: Fetch the details of a Zoho Sign Request by its request id.

 draftRequest()
    Params: [RequestObject] requestObject,
            [array] files
    Return: instance of RequestObject
    Throws: SignException
    Description: Uploads the files and draft's a request with the properties.

 updateRequest()
    Params: [RequestObject] requestObject,
            [array] files
    Return: instance of RequestObject
    Throws: SignException
    Description: Uploads the files and draft's a request with the properties.

 addFilesToRequest()
    Params: [INT] request_id,
            [array] files
    Return: instance of RequestObject
    Throws: SignException
    Description: Uploads the files to a draft request.

submitForSignature()
    Params: [RequestObject] requestObject
    Return: instance of RequestObject
    Throws: SignException
    Description: The requestObject contains a reference for a 'draft' request with fields added
    The function submits the 'draft' for signature.

selfSignRequest()
    Params: [RequestObject] requestObject
    Return: instance of RequestObject with
    Throws: SignException
    The requestObject contains a reference for a 'draft' request with fields added
    The function signs the document as the current user.
    Throws 'SignException' if failed to sign, usually due to wrong field properties set.

getRequestList()
    Params: [KEY NAME] category    (values: ALL, DRAFT, INPROGRESS, RECALLED, COMPLETED, DECLINED, EXPIRED, EXPIRING, MY_REQUESTS, MY_PENDING, SHREDDED),
            [INT]      start_index (optional, default:0),
            [INT]      row_count   (optional, default:100, max:100),
            [KEY NAME] sort_order  (optional, default:DESC, values : ASC, DESC),
            [KEY NAME] sort_column (optional, default:action_time, values: action_time, request_name, folder_name, owner_first_name, recipient_email, created_time, modified_time)
    Return: array of instances of RequestObject
    Throws: SignException
    Description: The function fetches the document list by category name.
    If only category name is specified, it fetches the 100 results sorted by last modified time of the category type.

generateEmbeddedSigningLink()
    Params: [INT] request_id,
            [INT] action_id,
            [URL] host (default:'null'/for opening in new tab)
    Return: URL string
    Throws: SignException
    Generates and return a signing link for the signer specified by action_id.
    Add the 'host' param for the website in which you want to embedd.
    NOTE: The signing URL is valid ONLY for 3 minutes before which the link has to be opened/loaded

getFieldDataFromCompletedDocument
    Params: [INT] requestId
    Return: instance of DocumentFormData
    Throws: SignException
    Description: Returns the pdf fields form data with key:value as data_label:data_value

setDownloadPath()
  Params: [String] path (local directory path)
  Return: -
  Throws: -
  Description: Set the local directory path in which the files will be downloaded using ZohoSign functions
               If not set, will default to "$_SERVER['DOCUMENT_ROOT']" path returned by PHP

getDownloadPath()
  Params: -
  Return: -
  Throws: -
  Description: Return the local download directory path set.
                If not set, will default to "$_SERVER['DOCUMENT_ROOT']" path returned by PHP.

downloadRequest()
  Params: [INT] requrest_id
  Return: true
  Throws: SignException
  Description: Downloads the documents of the request with its current version of signatures placed, either as a PDF if single document or as ZIP of multiple documents
               Documents will be downloaded to the directory path returned by 'getDownloadPath()' function.

downloadDocument()
  Params: [INT] request_id,
          [INT] document_id
  Return: true
  Throws: SignException
  Description: Downloads the specific document of the request with its current version of signatures placed as a PDF
               Documents will be downloaded to the directory path returned by 'getDownloadPath()' function.

downloadCompletionCertificate()
  Params: [INT] requrest_id
  Return: true
  Throws: SignException
  Description: Downloads the completion certificate ONLY for the signing completed request.
               Completion Cetrificate PDF will be downloaded to the directory path returned by 'getDownloadPath()' function.

recallRequest()
  Params: [INT] request_id
  Return: true
  Throws: SignException
  Description: Recalls the request if submitted.

remindRequest()
  Params: [INT] request_id
  Return: true
  Throws: SignException
  Description: Sends a reminder to the recipient of the request.

deleteRequest()
  Params: [INT] request_id
  Return: true
  Throws: SignException
  Description: Deletes the request. Deleted requests will be available in 'Trash'.

createNewFolder()
  Params: [INT] request_id
  Return: folder_id
  Throws: SignException
  Description: Creates new folder by the name, if it doesnt exist already.

getFieldTypes()
  Params: -
  Return: [stdClass] field_types
  Throws: -
  Description: Retrieves all field types.

getRequestTypes()
  Params: -
  Return: array of instances of 'RequestType'
  Throws: -
  Description: Retrieves all request types.

createRequestType()
  Params: [String] name
          [String] desctiption
  Return: instance of RequestType
  Throws:
  Description: Creates a new request type.

getFolderList()
  Params: -
  Return: [JSON] array of stdClass
  Throws:
  Description: Retrieves list of folders

```

#### Template Management functions

[](#template-management-functions)

```
createTemplate()
  Params: [TemplateObject] templateObject
          [array] files
  Return: TemplateObject
  Throws: SignException
  Description: Creates a Zoho Sign template. Returns TemplateObect of the created template.

updateTemplate( $templateObject, $files=null )
  Params: [TemplateObject] templateObject
          [array] files
  Return: TemplateObject
  Throws: SignException
  Description: Update an exsiting template with properties in the new templateObject, add files to the template.
              NOTE: The templateObject requires the request_id to be set.

addFilesToTemplate()
  Params: [INT] template_id
          [array] files
  Return: TemplateObject
  Throws: SignException
  Description: Adds files to the template.

getTemplate()
  Params: [INT] template_id
  return: [TemplateObject] templateObject
  Throws: SignException
  Description: Return the template object with its properties, which can be used to fill the prefill-fields and can be used for submission.

sendTemplate()
  Params: [TemplateObject] templateObject
          [Boolean] quick_send
  return: [RequestObject] requestObject
  Throws: SignException
  Description: The templateObject input param contains the TemplateObject returned by the "getTemplate()" function with the prefill-fields filled.
               Setting the quick send params as true sends the document for signature. Setting false, only creates a draft.
               Return value contains a RequestObject of the created request(either a DRAFT or INPROGRESS request).

getTemplatesList()
    Params: [INT]      start_index (optional, default:0),
            [INT]      row_count   (optional, default:100, max:100),
            [KEY NAME] sort_order  (optional, default:DESC, values : ASC, DESC),
            [KEY NAME] sort_column (optional, default:action_time, values: action_time, request_name, folder_name, owner_first_name, recipient_email, created_time, modified_time)
    Return: array of instances of TemplateObject
    Throws: SignException
    Description: The function fetches the templates list of the specified range, sorted by 'sort_column' name.
    If no params are passed, it fetches the 100 results sorted by last modified time of the category type.

deleteTemplate()
  Params: [INT] template_id
  Return: true
  Throws: SignException
  Description: Permanently deletes the template.

```

Exceptions
----------

[](#exceptions)

All functions of class 'ZohoSign' on event of bad/invalid requests to Zoho Sign throws class SignException. The Error message will be formatted like :

> SIGN EXCEPTION : \[error code\] : error message

Examples
--------

[](#examples)

Below examples are assuming ZohoSign::currentUser is set.

#### Create a Zoho Sign request using a document with text-tags and a signer. Send the draft for signature.

[](#create-a-zoho-sign-request-using-a-document-with-text-tags-and-a-signer-send-the-draft-for-signature)

```
    $reqObj = new RequestObject();
    $reqObj->setRequestName		( 'Partnership Agreement' );

    $partner = new Actions();
    $partner->setRecipientName	( "Will Smith" );
    $partner->setRecipientEmail	( "Willsmith@zylker.com" );
    $partner->setActionType		( Actions::SIGNER );
    $partner->setisEmbedded		( true );

    $reqObj->addAction	( $partner );

    $file1 = $_SERVER['DOCUMENT_ROOT']."/Documents/TextTagsAPI.pdf";
    $files = [
        new CURLfile( $file1 )
    ];

    $draftJSON	= ZohoSign::draftRequest( $reqObj,  $files);

```

#### Use template to create a request and send for signature

[](#use-template-to-create-a-request-and-send-for-signature)

```
    $template = ZohoSign::getTemplate( 2000002608137 );

    $template->setPrefillBooleanField	( "Premium Partner", true );
    $template->setPrefillTextField ( "Company", "Incredibles Inc" );
    $template->setPrefillDateField ( "Date", "08 July 2020" );

    $template->getActionByRole("Partner")->setRecipientName("John");
    $template->getActionByRole("Partner")->setRecipientEmail("john@incredibles.com");

    $resp_obj = ZohoSign::sendTemplate( $template, false );

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~115 days

Total

3

Last Release

1400d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3bdd00435ced06b3e8f4da39134d2e3fb6ba040e4434159a1b77bad8d407d22?d=identicon)[veraandco](/maintainers/veraandco)

---

Top Contributors

[![neo3k](https://avatars.githubusercontent.com/u/4956589?v=4)](https://github.com/neo3k "neo3k (1 commits)")

---

Tags

signZohodigital-signatureZoho Sign SDKZoho Sign PHP SDKZoho Sign PHP examples

### Embed Badge

![Health badge](/badges/veraandco-zoho-sign-php-sdk/health.svg)

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

###  Alternatives

[asciisd/zoho

Asciisd Zoho provide an elegant and easy way to communicate with Zoho CRM.

3751.9k](/packages/asciisd-zoho)[weble/zohoclient

Zoho API Client for oAuth auth and common tasks - PHP SDK

11145.6k3](/packages/weble-zohoclient)[delatbabel/apisecurity

API Security Helpers.

1378.1k](/packages/delatbabel-apisecurity)[asciisd/zoho-v3

Laravel Zoho API V3 Package

2121.3k](/packages/asciisd-zoho-v3)[tristanjahier/zoho-crm

A PHP client for the API of Zoho CRM.

2414.3k](/packages/tristanjahier-zoho-crm)

PHPackages © 2026

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