dev-master
9999999-dev https://github.com/xur/zoho-crm-phpA PHP wrapper library for Zoho CRM API.
MIT
The Requires
The Development Requires
by XUR from The Destiny
api php wrapper crm zoho
Wallogit.com
2017 © Pedro Peláez
A PHP wrapper library for Zoho CRM API.
This is an API wrapper library for Zoho CRM, written in PHP., (*1)
It aims to cover the whole API (every module and method), while providing a great abstraction and very easy-to-use methods., (*2)
5.5+
This package is currently at an early development stage. Full documentation will come when it is stable enough., (*3)
// Create a Zoho client
$zoho = new Zoho\CRM\Client('MY_ZOHO_AUTH_TOKEN');
// Use its supported modules to make easy requests...
$one_lead = $zoho->leads->getById('1212717324723478324');
$many_leads = $zoho->leads->getByIds(['8734873457834574028', '3274736297894375750']);
$admins = $zoho->users->getAdmins();
// ...or build them manually
$response = $zoho->request('Module', 'method', ['a_parameter' => 'blablebloblu']);
[Source] https://www.zoho.com/crm/help/api/using-authentication-token.html#Generate_Auth_Token, (*4)
https://accounts.zoho.com/apiauthtoken/nb/create?SCOPE=ZohoCRM/crmapi&EMAIL_ID=[Username/EmailID]&PASSWORD=[Password]&DISPLAY_NAME=[ApplicationName]
# #Mon Apr 23 07:36:42 PDT 2018 AUTHTOKEN=8c40d6720636c6bb2eadace2d2243ed1 RESULT=TRUE
| Methods | Comments | Response |
|---|---|---|
| fetch | execute query for the next page available | Response Object |
| fetchAll | execute queries for all pages available | Array of Response |
| getResponses | all responses fetched | Array of Response |
| getNumberOfPagesFetched | amount of pages fetched | Integer |
| Methods | Comments | Response |
|---|---|---|
| getContent | get JSON parsed response | Object |
| getRawData | get raw response | Object |
By default, some modules are enabled in src/Client.php, (*5)
Every modules (except Users) have the following methods (src/Api/Modules/AbstractRecordsModule.php):, (*6)
getAll
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
/**
* @var $many_leads \Zoho\CRM\Api\RequestPaginator
*/
$leads = $zoho->leads->getAll();
echo '
';
print_r($leads->fetch()->getContent());
echo '
';
RequestPaginator Object, (*7)
getById
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$lead = $zoho->leads->getById('3211639000000152457');
echo '
';
print_r($lead->getContent());
echo '
';
Response Object, (*8)
insert
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$zoho->leads->insert([
'Company' => 'TEST',
'Last Name' => 'TEST'
]);
Response Object, (*9)
delete
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$zoho->leads->delete('3211639000000152457');
Response Object, (*10)
deleteMany
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$leads = $zoho->leads->deleteMany(['3211639000000152553', '3211639000000152560']);
echo '
';
print_r($leads);
echo '
';
Response Object, (*11)
{"result":{"code":"5000","message":"Record Id(s) : 3211639000000152553;3211639000000152560,Record(s) deleted successfully"}
search
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$leads = $zoho->leads->search('((Company:TEST)OR(Last Name:TEST))');
echo '
';
print_r($leads->fetch()->getContent());
echo '
';
RequestPaginator Object, (*12)
getBy
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$leads = $zoho->leads->getBy('Company', 'TEST');
echo '
';
print_r($leads->fetch()->getContent());
echo '
';
RequestPaginator Object, (*13)
update
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$lead = $zoho->leads->update('3211639000000155006', [
'Company' => 'TEST99'
]);
echo '
';
print_r($lead->getContent());
echo '
';
Response Object, (*14)
updateMany
require './vendor/autoload.php';
// Create a Zoho client
$zoho = new Zoho\CRM\Client('0c85ee5db4119df7ad21bb9581d08670');
$leads = $zoho->leads->updateMany([
[
'Id' => '3211639000000158001',
'Company' => 'Company modified'
],
[
'Id' => '3211639000000155013',
'Company' => 'Company modified 2'
]
]);
echo '
';
print_r($leads->getRawData());
echo '
';
Response Object, (*15)
phpunit.xml
./vendor/bin/phpunit commandA PHP wrapper library for Zoho CRM API.
MIT
api php wrapper crm zoho