matthewnw / zoho-api
一个用于消费Zoho的Creator和Reports API的类。
1.0.1
2018-02-17 21:38 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2024-09-29 05:01:51 UTC
README
库为Zoho Creator和Zoho Reports提供API包装器 https://www.zoho.com。
PSR-4兼容
功能
- 访问Creator应用程序并获取/添加/删除记录
- 访问Reports并导入/导出数据
安装
安装库的首选方法是使用composer。
运行
composer require matthewnw/zoho-api
示例
Creator示例
use Matthewnw\Zoho\Creator\ZohoCreatorClient;
// Initializes the class.
$zohoCreatorClient = new ZohoCreatorClient($apiToken);
// Get a list of available Applications
$creatorapplications = $zohoCreatorClient->applications();
// Get a specific Application instance
$creatorapplication = $zohoCreatorClient->application($applicationName);
// get records from a Creator View and chain application method
$creatorViewRecords = $zohoCreatorClient->application($applicationName)->getRecords($viewName);
// add records form a Creator Form
$creatorapplication->add($formName, $dataArray);
Reports示例
use Matthewnw\Zoho\Creator\ZohoCreatorClient;
$zohoReportsClient = new ZohoReportsClient($apiToken);
// https://zohoreportsapi.wiki.zoho.com/importing-bulk-data.html
$uri = $zohoReportsClient->getURI($emailId, $reportsDatabaseName, $reportsTableName);
$importType = 'TRUNCATEADD'; // APPEND, TRUNCATEADD, UPDATEADD
$autoIdentify = 'TRUE';
$onError = 'ABORT';
$importData = json_encode($report_leads);
$config = ['ZOHO_IMPORT_FILETYPE' => 'JSON'];
$importReports = $zohoReportsClient->importDataAsString($uri, $importType, $importData, $autoIdentify, $onError, $config);
Zoho API文档
Reports API
https://zohoreportsapi.wiki.zoho.com/
ReportClient.php API指南
https://www.zoho.com/reports/api/?php#zoho-reports-api
Creator API
https://www.zoho.eu/creator/help/api/
作者
Matthew Williams matthew@codelaunch.uk