deadmantfa/yii2-zoho-api-client 问题修复 & 功能扩展

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

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

deadmantfa/yii2-zoho-api-client

Composer 安装命令:

composer require deadmantfa/yii2-zoho-api-client

包简介

A Client for Zoho API's

README 文档

README

A Client for Zoho RESTful API's

Powered By Yii2 Type

Packagist Version GitHub Packagist Stars GitHub top language Packagist Downloads GitHub stars GitHub last commit Maintenance saythanks

forthebadge

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist deadmantfa/yii2-zoho-api-client "^v1.0.x"

or add

"deadmantfa/yii2-zoho-api-client": "^v1.0.x"

to the require section of your composer.json file.

Configuration

Once the extension is installed, add it to your configuration :

Please note the redirect url for OAUTH2 to work properly, please add it to your client on Zoho before continuing further. Replace <YOUR_DOMAIN_NAME> with an actual domain or localhost

<YOUR_DOMAIN_NAME>/zoho/default/auth?authclient=zoho

In your params.php or params-local.php define the following

    'zoho-api-client-id' => '<ZOHO_API_CLIENT_ID>',
    'zoho-api-client-secret' => '<ZOHO_API_CLIENT_SECRET>',
    'zoho-organization-id' => '<ZOHO_ORGANIZATION_ID>',
    'zoho-redirect-uri' => '<YOUR_DOMAIN_NAME>/zoho/default/auth?authclient=zoho'

Add the following in one of these file

app/common/config/main.php or app/backend/config/main.php

    'modules' => [
        'zoho' => [
            'class' => \deadmantfa\yii2\zoho\Module::class,
        ],
    ],
    'components' => [
        'authClientCollection' => [
            'class' => \yii\authclient\Collection::class,
            'clients' => [
                'zoho' => [
                    'class' => \deadmantfa\yii2\zoho\auth\ZohoAuthClient::class,
                    'clientId' => $params['zoho-api-client-id'],
                    'clientSecret' => $params['zoho-api-client-secret'],
                    'returnUrl' => $params['zoho-redirect-uri'],
                ],
            ],
        ],
        'zoho'=> [
            'class' => \deadmantfa\yii2\zoho\components\ZohoApiClient::class,
            'apiBaseUrl'=>'https://inventory.zoho.com/api/v1/',
            'organizationId'=>$params['zoho-organization-id']
        ]
    ];  

For Migration add the following to

app/console/config/main.php

use yii\console\controllers\MigrateController;

    'controllerMap' => [
        'migrate' => [
            'class' => MigrateController::class,
            'migrationPath' => [
                '@app/migrations',
                '@yii/rbac/migrations', // Just in case you forgot to run it on console (see next note)
            ],
            'migrationNamespaces' => [
                'deadmantfa\yii2\zoho\migrations',
            ],
        ],
    ],

Then run the following command

./yii migrate

Usage

To use the zoho api we need to first authorize and generate access_token and refresh_token

(http://<YOUR_DOMAIN_NAME>/zoho)

Follow the screenshots below

Step 1

Step 2

Step 3

After generating the access token and refresh token you can now call any api which is provided by Zoho

Yii::$app->zoho->get('items', []);
Yii::$app->zoho->post('items', []);
Yii::$app->zoho->put('items', []);
Yii::$app->zoho->delete('items', []);

Zoho Rest API Documentation

Dependencies

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固