承接 mctekk/zohocrm 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mctekk/zohocrm

最新稳定版本:0.1.1

Composer 安装命令:

composer require mctekk/zohocrm

包简介

Wrapper for interact with Zoho CRM API for php

README 文档

README

The Zoho CRM library is a simple wrapper around Zoho API

At MC we work a lot with Zoho and we found ourself repeating the same patter over and over that's why we build this library.

Installation

Using composer, execute the following command to add the requirement to your composer.json

$ composer require mctekk/zohocrm:^0.1

Let's start

Zoho API V2 has change the wey they handle connecto to the API, it now uses OAuth instead of just simple private and public keys. So you will have to do the following things to get this package to work with your app

Todo In future version we will add the refresh_token generator directly as a php script

<?php

use Zoho\CRM\ZohoClient;

$ZohoClient = new ZohoClient(); // Make the connection to zoho api
$ZohoClient->setAuthRefreshToken(getenv('ZOHO_AUTH_REFRESH_TOKEN'));
$ZohoClient->setZohoClientId(getenv('ZOHO_CLIENT_ID'));
$ZohoClient->setZohoClientSecret(getenv('ZOHO_CLIENT_SECRET'));
$refresh = $ZohoClient->generateAccessTokenByRefreshToken();
//or with redis $ZohoClient->manageAccessTokenRedis($redis);

$this->zohoClient->setModule('Leads');

$lead = new Lead();

$leadRequest = [
	'First_Name' => 'Test',
	'Last_Name' => 'Zoho',
	'Phone' => '000000000',
	'Email' => 'testzoho@mctekk.com'
];

$response = $this->zohoClient->insertRecords(
	$leadRequest,
	['wfTrigger' => 'true']
);

$response->getResponseData();

The above values of the $request array can be taken from POST if you are using forms in landing page :D, just be sure that all the keys(name of the field on html) in the array have to be valid properties in the entity Lead of zoho, default properties can be found on documentation here or make sure that those properties exist in your account if you custom your Lead on Zoho; the following convention are made:

  • Name of fields are not CamelCase.
  • Name with space between words, space is substituted by an "_".
  • Need to clean(unset) from the array all the values that are not part of the entity, if you don't wanna make this, create another clean array.

Users of the .eu domain (i.e. your CRM URL is crm.zoho.eu, rather than crm.zoho.com) should call setEuDomain() after instantiating ZohoClient, i.e.

$ZohoClient = new ZohoClient(); // Make the connection to zoho api
$ZohoClient->setAuthRefreshToken(getenv('ZOHO_AUTH_REFRESH_TOKEN'));
$ZohoClient->setZohoClientId(getenv('ZOHO_CLIENT_ID'));
$ZohoClient->setZohoClientSecret(getenv('ZOHO_CLIENT_SECRET'));
$refresh = $ZohoClient->generateAccessTokenByRefreshToken();
$ZohoClient->setEuDomain();
$ZohoClient->setModule('Leads'); // Set the module

统计信息

  • 总下载量: 70.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 52
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 51
  • Watchers: 16
  • Forks: 59
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固