asad/laravel-zoho-api-wrapper

This is ZOHO REST API-V2 wrapper

3.0.2 2022-06-03 00:45 UTC

README

Laravel 5.x Latest Stable Version Latest Unstable Version Total Downloads License

To easing ZOHO REST API V2 call for Laravel application.

Requirements

Installation

$ composer require asad/laravel-zoho-api-wrapper

Configuration

$ 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
Is it CN DC?
[0] No
[1] Yes
Scopes? (ex: ZohoCRM.modules.ALL,ZohoCRM.settings.ALL) If you skip it will enable ex: scopes
> (zoho scopes)

Copy the following url, paste on browser and hit return.
https://accounts.zoho.com/oauth/v2/auth?....

How to use (example)

> 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
        }
    }
}

APIs

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

Documentation

See the documentation at : Zoho API Wrapper

Contributing

Contributions are welcome and will be fully credited.

I accept contributions via Pull Requests on Github.

Issues

If you discover any issues, please email at asadku34@gmail.com also you can create issue on the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.