Download the PHP package mctekk/zohocrm without Composer
On this page you can find all versions of the php package mctekk/zohocrm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mctekk/zohocrm
More information about mctekk/zohocrm
Files in mctekk/zohocrm
Package zohocrm
Short Description Wrapper for interact with Zoho CRM API for php
License MIT
Informations about the package zohocrm
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
Using composer, execute the following command to add the requirement to your composer.json
$ composer require mctekk/zohocrm:^0.1
Let's 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 [https://api-console.zoho.com/]
- Make sure to elect Web Based App and Follow this tutorial https://www.zoho.com/crm/developer/docs/api/register-client.html
- 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
- This URL will redirect to the client URI with a query string code
- Take the code query string and make a POST https://accounts.zoho.com/oauth/v2/token 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
The above values of the $request array can be taken from POST if you are using forms in landing page :D, just be sure that all the keys(name of the field on html) in the array have to be valid properties in the entity Lead of zoho, default properties can be found on documentation here or make sure that those properties exist in your account if you custom your Lead on Zoho; the following convention are made:
- Name of fields are not CamelCase.
- Name with space between words, space is substituted by an "_".
- Need to clean(unset) from the array all the values that are not part of the entity, if you don't wanna make this, create another clean array.
Users of the .eu domain (i.e. your CRM URL is crm.zoho.eu, rather than crm.zoho.com) should call setEuDomain()
after instantiating ZohoClient, i.e.