chi-teck/zoho-crm-connector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

chi-teck/zoho-crm-connector

最新稳定版本:1.0.0-alpha1

Composer 安装命令:

composer require chi-teck/zoho-crm-connector

包简介

Zoho CRM connector

README 文档

README

A simple connector to Zoho CRM API v3.

Unlike official Zoho SDK this connector does not provide helpers for each API endpoint. Essentially this is just a thin wrapper around Guzzle HTTP client that authorizes requests to Zoho API. Note that you need to handle connection errors yourself.

System Requirements

PHP 8.1 or later

Installation

composer require chi-teck/zoho-api-connector

Register your application in Zoho Developer Console. The way you obtain auth token (grant code) depends on the application type. Refer to Authorization Request guide for details.

Usage

<?php declare(strict_types = 1);

use GuzzleHttp\Client;
use ZohoCrmConnector\Config;
use ZohoCrmConnector\Connector;
use ZohoCrmConnector\Auth\Storage\FileStorage;
use ZohoCrmConnector\Auth\AccessTokenProvider;

require __DIR__ . '/../vendor/autoload.php';

// Configuring the connector.
$config = new Config(
  domain: 'https://accounts.zoho.com',
  clientId: '•••••••••••••••••••••••••••••••••••',
  clientSecret: '••••••••••••••••••••••••••••••••••••••••••',
  authToken: '•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••',
);

$storage = new FileStorage(__DIR__ . '/path/to/zoho-token');
$token_provider = new AccessTokenProvider($config, $storage, new Client());

$connector = new Connector($token_provider);

// Retrieving data.
$response = $connector->get('Leads?fields=Last_Name&per_page=5');
print_r($response->decode());

// Posting data.
$data = [
    [
      "First_Name" => "Mickey",
      "Last_Name" => "Mouse",
    ],
];
$response = $connector->post('Leads', ['data' => $data]);
print_r($response->decode());

License

GNU General Public License, version 2 or later.

统计信息

  • 总下载量: 204
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2022-10-03