To easing ZOHO REST API V2 call for Laravel application.
$ composer require asad/laravel-zoho-api-wrapper
$ php artisan zoho:authentication
Input CRM client id:
> (your client id)
Input CRM client secret:
> (your client secret)
Input client domain (ex: example.com):
> (your client domain name)
Select your protocol.[http]:
[0] http
[1] https
> 0
Select your env. [sandbox]:
[0] sandbox
[1] live
> 0
Copy the following url, paste on browser and hit return.
https://accounts.zoho.com/oauth/v2/auth?....
> ZohoController.php
use Asad\Zoho\Api\RecordApi;
use Asad\Zoho\Exception\ZohoException;
Class ZohoController extends Controller
{
public function testAPI()
{
$param = [
'headers' => [
'If-Modified-Since' => date('c')
],
'data' => [
'page' => 1,
'per_page' => 20,
]
];
$response = $this->listOfRecords('Leads', $param);
dd($response);
}
public function listOfRecords($module, array $param)
{
$record_api = new RecordApi();
try {
$response = $record_api->listOfRecords($module, $param);
if ($response->getStatus() == 'success') {
$crm_data = $response->getResults();
return $crm_data;
}
} catch(ZohoException $e) {
// Handle Exception and return
}
}
}
Currently there are only 7 api wrappers. Those are follows:
- Record APIs
- Meta Data APIs (It also belong Module API)
- Note APIs
- Related List APIs
- Tag APIs
- Attachments APIs
- Query APIs
See the documentation at : Zoho API Wrapper
Contributions are welcome and will be fully credited.
I accept contributions via Pull Requests on Github.
If you discover any issues, please email at asadku34@gmail.com also you can create issue on the issue tracker.
The MIT License (MIT). Please see License File for more information.