opifer / smarteventmanager
用于使用Voorraedt智能事件管理应用程序编程接口(API)的库
1.0
2014-08-22 11:08 UTC
Requires
- guzzle/guzzle: ~3.9
- jms/serializer: 0.*
This package is auto-updated.
Last update: 2024-09-24 22:30:25 UTC
README
SmartEventManager API PHP客户端允许PHP开发者在其PHP代码中使用SmartEventManager API。客户端基于SEM API版本8.1.16编写,但其他版本可能也能正常工作。所有当前实现的API功能均在description.json中描述,对于扩展客户端功能,这也是一个起点。
先决条件
- SmartEventManager API版本8.1.16或更高版本
- PHP 5.3或更高版本
- curl、json扩展必须启用
- 使用composer获取依赖项(见https://getcomposer.org.cn)
要安装
composer require opifer/smarteventmanager
或者将其添加到您的composer.json中,然后运行composer update
{
"require": {
"opifer/smarteventmanager": "0.*"
}
}
快速示例
获取公司
<?php require 'vendor/autoload.php'; use Opifer\SmartEventManager\Client\Config; use Opifer\SmartEventManager\Client\Client; use Guzzle\Http\Exception\BadResponseException; use Guzzle\Http\Exception\CurlException; $config = new Config(); $config->setBaseUrl('https://myapihost.dev') ->setUserName('user') ->setPassword('password'); //->setDebug(); // Show Guzzle request & response (headers + body) try { $client = Client::getInstance($config); $companies = $client->getCompanies(); } catch (CurlException $e) { print "Error CurlException: " . $e->getMessage() . "\n"; } catch (BadResponseException $e) { print "Error BadResponseException: " . $e->getMessage() . "\n"; }