kaweb/honeycomb

一个用于与基于PHP 7构建的Inventory Hive API交互的库

1.0.0 2019-04-26 10:31 UTC

README

一个用于与基于PHP构建的Property Reporting API交互的库

请参考API文档以了解端点参数。

安装

composer

执行以下命令以获取包的最新版本:

composer require kaweb/honeycomb

示例

使用您的登录详细信息连接到Inventory Hive API

use Kaweb\Honeycomb\Application as Honeycomb;

$honeycomb = new Honeycomb([
	'username' => '',
	'password' => '',
	'client_id' => '',
	'client_secret' => '',
]);

每个对象都支持创建检索更新删除 RESTful操作

访问所有用户数据

$honeycomb->users()->retrieve();

访问特定用户的数据

$honeycomb->users()->retrieve(123);

更新特定用户的数据

$honeycomb->users()->update(123 [
	'first_name' => 'Busy',
	'last_name' => 'Bee'
]);

删除特定用户

$honeycomb->users()->delete(123);

某些对象具有在API文档中定义的自定义操作

注册一家新公司

$honeycomb->companies()->register([
	"email" =>            "example@propertyreporting.co.uk",
    "first_name" =>       "Buzzy",
    "last_name" =>        "Bee",
    "phone" =>            "123456789",
    "description" =>      "Landlord",
    "company_name" =>     "Inventory Hive",
]);