hissy/ kintone-php
PHP版的Kintone SDK提供了方便访问kintone API的接口。
1.0.0
2024-01-15 03:30 UTC
Requires
- ext-json: *
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.9
- phpunit/phpunit: ^8.5.20
This package is auto-updated.
Last update: 2024-09-25 07:14:34 UTC
README
这是一个使用PHP编写的库,旨在简化cybozu.com提供的kintone REST API的使用。
要求条件
PHP 8.0+
如果需要使用更早版本的PHP,请使用beta分支。
安装方法
使用Composer
"require": {
"hissy/kintone-php": "dev-master"
}
使用方法
require 'vendor/autoload.php'; use Kintone\Request; use Kintone\Base; use Kintone\App\App; // サブドメイン $subdomain = '012ab'; // APIトークン $apitoken = 'BuBNIwbRRaUvr33nWXcfUZ5VhaFsJxN0xH4NPN92'; // 初期設定 $request = new Request($subdomain,$apitoken); // アプリ情報の取得 $appID = 15; $app = new App($request); try { // IDを指定してアプリ情報を取得 $res = $app->getByID($appID); echo $res->getName(); } catch (\GuzzleHttp\Exception\ServerException $e) { // 5xxエラーレスポンスの取得 echo $e->getResponse()->getBody(); } catch (\GuzzleHttp\Exception\ClientException $e) { // 4xxエラーレスポンスの取得 echo $e->getResponse()->getBody(); } catch (\GuzzleHttp\Exception\GuzzleException $e) { echo get_class($e) . ': ' . $e->getMessage(); } // 短縮型 $name = (new App($request))->getByID($appID)->getName(); echo $name; // コマンドとパラメーターを直接指定して情報を取得する方法 $app = new Base($request); $app->setResource('app'); $res = $app->get(['id' => $appID]); echo $res->getValue('name'); // 結果は App を使った場合と同じ
详细信息请参考Wiki。
许可证
MIT许可证