PHPackages                             tklein/php-sdk-zoho-desk - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. tklein/php-sdk-zoho-desk

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

tklein/php-sdk-zoho-desk
========================

PHP SDK for Zoho Desk API v1 integration.

3.0.4(2y ago)762.4k↓33.1%10[1 PRs](https://github.com/thomas-kl1/php-sdk-zoho-desk/pulls)MITPHPPHP ^7.4||^8.0

Since Jun 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/thomas-kl1/php-sdk-zoho-desk)[ Packagist](https://packagist.org/packages/tklein/php-sdk-zoho-desk)[ Docs](https://github.com/thomas-kl1/php-sdk-zoho-desk)[ Fund](https://paypal.me/thomaskl1)[ RSS](/packages/tklein-php-sdk-zoho-desk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (13)Used By (0)

Zoho Desk PHP SDK
=================

[](#zoho-desk-php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/905195317798afcd580b66c40b7f35f0d76783bff5141f971e5ab8e1ca2e0e43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746b6c65696e2f7068702d73646b2d7a6f686f2d6465736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tklein/php-sdk-zoho-desk)[![Codacy Badge](https://camo.githubusercontent.com/75d1f7366788a9952e419664e16ca3d7b3a67c3bdc703cb3e6d42402aa3c4220/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f67726164652f32623863313561663434616434646465383638363533323838376463616330612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://app.codacy.com/app/thomas-klein/php-sdk-zoho-desk)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/322bf931140750c7672a0f2292190332599ff5908dcfc55821d5766169b17fdc/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f74686f6d61732d6b6c312f7068702d73646b2d7a6f686f2d6465736b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thomas-kl1/php-sdk-zoho-desk/?branch=master)[![Code Climate](https://camo.githubusercontent.com/ad3c0a2deeefbc60576807359474bed66375c2c4f547531270421bfaab3a573d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f74686f6d61732d6b6c312f7068702d73646b2d7a6f686f2d6465736b2e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/thomas-kl1/php-sdk-zoho-desk)[![License: MIT](https://camo.githubusercontent.com/0e9b35008724696edcd47bc127e2b6b07aee1119176af3e07a38fbada42217fa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74686f6d61732d6b6c312f7068702d73646b2d7a6f686f2d6465736b2e7376673f7374796c653d666c61742d737175617265)](./LICENSE)[![Packagist](https://camo.githubusercontent.com/87404b5e30bcb1372b5983195198836b5112a7dabfe002fa0b8a6a64e7414afa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746b6c65696e2f7068702d73646b2d7a6f686f2d6465736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tklein/php-sdk-zoho-desk/stats)[![Packagist](https://camo.githubusercontent.com/58a84ba05ab945981a321bd4a7ea7ad7b7c3956f0a326b096af8c7ff0d1bd452/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f746b6c65696e2f7068702d73646b2d7a6f686f2d6465736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tklein/php-sdk-zoho-desk/stats)

This SDK library

- [Setup](#setup)
- [Features](#features)
- [Settings](#settings)
- [Documentation](#documentation)
- [Support](#support)
- [Authors](#authors)
- [License](#license)

Setup
-----

[](#setup)

```
composer require tklein/php-sdk-zoho-desk

```

Features
--------

[](#features)

You can execute all CRUD actions on all entities available in Zoho Desk. Please check you have the allowed scope of operation with the proper registered OAuth access token.

Settings
--------

[](#settings)

**All the basic constants settings are available in `\Zoho\Desk\Api\Metadata`.**

First you need to have a valid access token. First of all connect to your Zoho developer console from your region of subscription:

for Europe the url is: \[\]

- Create or use an existing "Self Client" application. You may need these informations:
- Generate the grant code, with the proper scopes. ***`aaaserver.profile.READ` scope is mandatory***The full list of scopes is availables at:
- Generate the persistence auth token file with the Zoho SDK:
    - Client ID: you can find it in the Zoho api developer console
    - Client Secret: you can find it in the Zoho api developer console
    - Redirect url: this is a dummy url, it's part of the oauth standaard but not actively used
    - Current User Email: this is the user email used to create the self client integration (./oauth/user/info)
    - Org ID: this is your organization ID in your Zoho Desk application: Setup and Configuration -&gt; DEVELOPER SPACE -&gt; API -&gt; Zoho Desk API -&gt; OrgId (Orgnization ID) field value

```
include __DIR__ . /* Relative path to the vendor autoloader */ '/vendor/autoload.php';

use Zoho\Desk\Api\Metadata;
use Zoho\Desk\Client\ConfigProviderBuilder;
use Zoho\OAuth\ZohoOAuth;

$configBuilder = ConfigProviderBuilder::getInstance();
$configBuilder->setClientId(/* Client ID */)
    ->setClientSecret(/* Client Secret */)
    ->setRedirectUrl(/* Redirect Url */)
    ->setCurrentUserEmail(/* User Email */)
    ->setApiBaseUrl(/* API Endpoint by region */)
    ->setApiVersion(Metadata::API_VERSION)
    ->setOrgId(/* Org ID */)
    ->setIsSandbox(/* Sandbox Status */)
    ->setAccountsUrl(/* Accounts Url */)
    ->setTokenPersistencePath(/* Persistence Path */);

// Add php code if the zcrm_oauthtokens.txt to create the file if it does not already exists.

ZohoOAuth::initialize($configBuilder->create()->get());
ZohoOAuth::getClientInstance()->generateAccessToken($grantCode);
```

Create the configuration object with your API details and credentials.

```
include __DIR__ . /* Relative path to the vendor autoloader */ '/vendor/autoload.php';

use Zoho\Desk\Api\Metadata;
use Zoho\Desk\Client\ConfigProviderBuilder;

$configBuilder = ConfigProviderBuilder::getInstance();
$configBuilder->setClientId(/* Client ID */)
    ->setClientSecret(/* Client Secret */)
    ->setRedirectUrl(/* Redirect Url */)
    ->setCurrentUserEmail(/* User Email */)
    ->setApiBaseUrl(/* API Endpoint by region */)
    ->setApiVersion(Metadata::API_VERSION)
    ->setOrgId(/* Org ID */)
    ->setIsSandbox(/* Sandbox Status */)
    ->setAccountsUrl(/* Accounts Url */)
    ->setTokenPersistencePath(/* Persistence Path */);
```

You can use the following pre-defined values from the `Metadata` class:

```
final class Metadata
{
    public const API_FIELD_CURRENT_USER_EMAIL = 'currentUserEmail';
    public const API_FIELD_BASE_URL = 'apiBaseUrl';
    public const API_FIELD_VERSION = 'apiVersion';
    public const API_ENDPOINT_US = 'desk.zoho.com/api';
    public const API_ENDPOINT_AU = 'desk.zoho.com.au/api';
    public const API_ENDPOINT_EU = 'desk.zoho.eu/api';
    public const API_ENDPOINT_IN = 'desk.zoho.in/api';
    public const API_ENDPOINT_CN = 'desk.zoho.com.cn/api';
    public const API_VERSION = 'v1';
    public const ACCESS_TYPE = 'offline';
    public const ORG_ID = 'orgId';
    public const API_ACCOUNTS_US = 'https://accounts.zoho.com';
    public const API_ACCOUNTS_AU = 'https://accounts.zoho.com.au';
    public const API_ACCOUNTS_EU = 'https://accounts.zoho.eu';
    public const API_ACCOUNTS_IN = 'https://accounts.zoho.in';
    public const API_ACCOUNTS_CN = 'https://accounts.zoho.com.cn';
}
```

Documentation
-------------

[](#documentation)

The entry point of the SDK is the gateway facade:

```
use Zoho\Desk\Gateway;

$gateway = new Gateway($configBuilder->create());
```

The facade is easy to use:

```
use Zoho\Desk\Exception\CouldNotDeleteException;
use Zoho\Desk\Exception\CouldNotReadException;
use Zoho\Desk\Exception\CouldNotSaveException;
use Zoho\Desk\Model\ListCriteriaBuilder;

$ticketDataObject = $gateway->getDataObjectFactory()->create('tickets', /* Entity values */);

try {
    $ticketDataObject = $gateway->getOperationPool()->getCreateOperation('tickets')->create($ticketDataObject);
} catch (CouldNotSaveException $e) {
    // Handle the exception...
}

try {
    $ticketDataObject = $gateway->getOperationPool()->getReadOperation('tickets')->get(1234);
} catch (CouldNotReadException $e) {
    // Handle the exception...
}

try {
    $criteriaBuilder = new ListCriteriaBuilder();
    // $criteriaBuilder->setFields()->setFilters()...
    $ticketList = $gateway->getOperationPool()->getListOperation('tickets')->getList($criteriaBuilder->create());
    $ticketList = $gateway->getOperationPool()->getListOperation('tickets')->getByIds([1,2,3]);
} catch (CouldNotReadException $e) {
    // Handle the exception...
}

try {
    $ticketDataObject = $gateway->getOperationPool()->getUpdateOperation('tickets')->update($ticketDataObject);
} catch (CouldNotSaveException $e) {
    // Handle the exception...
}

try {
    $gateway->getOperationPool()->getDeleteOperation('tickets', ['resolution'])->delete(1234);
} catch (CouldNotDeleteException $e) {
    // Handle the exception...
}
```

Support
-------

[](#support)

Raise a new [request](https://github.com/thomas-kl1/php-sdk-zoho-desk/issues) to the issue tracker.

Authors
-------

[](#authors)

- **Thomas Klein** - *Maintainer* - [![GitHub followers](https://camo.githubusercontent.com/e0e283f9de9d23a7bfeac3e6088a3a3a6844c123e1861f866242cd80e3361088/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f74686f6d61732d6b6c312e7376673f7374796c653d736f6369616c)](https://github.com/thomas-kl1)
- **Contributors** - *Contributor* - [![GitHub contributors](https://camo.githubusercontent.com/ce348f535b5ce32eda57307470b9b5d85a6393a8a4803f280b6cb6a4da23a060/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f74686f6d61732d6b6c312f7068702d73646b2d7a6f686f2d6465736b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/thomas-kl1/php-sdk-zoho-desk/graphs/contributors)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](./LICENSE) details.

***That's all folks!***

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~138 days

Recently: every ~276 days

Total

11

Last Release

776d ago

Major Versions

1.0.2 → 2.0.02020-06-29

2.1.1 → 3.0.02021-03-23

PHP version history (3 changes)1.0.0PHP ^7.2

2.1.0PHP ^7.4

3.0.2PHP ^7.4||^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95669?v=4)[Thom](/maintainers/thomasklein)[@thomasklein](https://github.com/thomasklein)

---

Top Contributors

[![thomas-kl1](https://avatars.githubusercontent.com/u/20971693?v=4)](https://github.com/thomas-kl1 "thomas-kl1 (30 commits)")[![stefnats](https://avatars.githubusercontent.com/u/1174473?v=4)](https://github.com/stefnats "stefnats (2 commits)")[![freespiritstays](https://avatars.githubusercontent.com/u/33014720?v=4)](https://github.com/freespiritstays "freespiritstays (1 commits)")[![fsalomon](https://avatars.githubusercontent.com/u/4098510?v=4)](https://github.com/fsalomon "fsalomon (1 commits)")

---

Tags

integrationphpsdksdk-phpzohozoho-apizoho-deskzohodeskzohodesk-apizohodesk-api-sdkzohodesk-sdkphpclientsdkserviceoauthZohosupportcustomercustomer servicedeskticketzoho-desk

### Embed Badge

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

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

###  Alternatives

[happyr/linkedin-api-client

LinkedIn API client. Handles OAuth, CSRF protection. Easy to implement and extend. This is a standalone library for any composer project.

1991.6M12](/packages/happyr-linkedin-api-client)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[bocharsky-bw/vkontakte-php-sdk

Vkontakte PHP SDK

3259.2k1](/packages/bocharsky-bw-vkontakte-php-sdk)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

194.1k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

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