asad/laravel-zoho-api-wrapper

这是 ZOHO REST API-V2 包装器

3.0.2 2022-06-03 00:45 UTC

README

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

简化 Laravel 应用程序对 ZOHO REST API V2 调用的过程。

要求

安装

$ 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
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?....

如何使用(示例)

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

API

目前只有 7 个 API 包装器。它们如下:

  • 记录 API
  • 元数据 API(它也属于模块 API)
  • 备注 API
  • 相关列表 API
  • 标签 API
  • 附件 API
  • 查询 API

文档

查看文档: Zoho API 包装器

贡献

贡献受到 欢迎,并将得到全部 认可

我通过 Github 上的 Pull Requests 接受贡献。

问题

如果您发现任何问题,请发送电子邮件至 asadku34@gmail.com,您也可以在问题跟踪器上创建问题。

致谢

许可

MIT 许可证(MIT)。请参阅 许可证文件 获取更多信息。