PHPackages                             mctekk/zohocrm - 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. mctekk/zohocrm

ActiveLibrary[API Development](/categories/api)

mctekk/zohocrm
==============

Wrapper for interact with Zoho CRM API for php

0.1.1(5y ago)5170.3k↓33.3%59[5 issues](https://github.com/mctekk/zohocrm/issues)[1 PRs](https://github.com/mctekk/zohocrm/pulls)2MITPHPPHP &gt;=7.2

Since Jun 24Pushed 5y ago16 watchersCompare

[ Source](https://github.com/mctekk/zohocrm)[ Packagist](https://packagist.org/packages/mctekk/zohocrm)[ RSS](/packages/mctekk-zohocrm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (8)Used By (2)

**Zoho** CRM library for PHP
============================

[](#zoho-crm-library-for-php)

The Zoho CRM library is a simple wrapper around Zoho API

At MC we work a lot with Zoho and we found ourself repeating the same patter over and over that's why we build this library.

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

[](#installation)

Using composer, execute the following command to add the requirement to your `composer.json`

```
$ composer require mctekk/zohocrm:^0.1

```

Let's start
-----------

[](#lets-start)

Zoho API V2 has change the wey they handle connecto to the API, it now uses OAuth instead of just simple private and public keys. So you will have to do the following things to get this package to work with your app

- Register a Zoho Client via its Developer Console \[\]
- Make sure to elect Web Based App and Follow this tutorial
- Once you have the Client ID and Its Secret we will need to generate a refresh\_token
- To generate the refresh\_token you will need to visit , change {client\_id} with the client id and redirect\_uri with the value you configure the cliente
    - [https://accounts.zoho.com/oauth/v2/auth?scope=ZohoCRM.modules.ALL&amp;client\_id={client\_id}&amp;response\_type=code&amp;access\_type=offline&amp;redirect\_uri={redirect\_uri}](https://accounts.zoho.com/oauth/v2/auth?scope=ZohoCRM.modules.ALL&client_id=%7Bclient_id%7D&response_type=code&access_type=offline&redirect_uri=%7Bredirect_uri%7D)
- This URL will redirect to the client URI with a query string code
- Take the code query string and make a POST  sending
    - grant\_type : authorization\_code
    - client\_id : {client\_id}
    - client\_secret : {client\_secret}
    - redirect\_uri : {redirect\_uri}
    - code : {code}
- This final request will provide you with the refresh\_token .
    - **Take into consideration refresh\_token could be consider the identifier of the zoho account you are interacting with**
- Set client\_id, client\_secret and refresh\_token on .env and the package will handle the rest

**Todo** In future version we will add the refresh\_token generator directly as a php script

```
