loudclear / boxsuite-api
此包已被废弃且不再维护。未建议替代包。
BoxSuite API
0.2
2015-09-25 16:52 UTC
Requires
- php: >=5.4.0
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is auto-updated.
Last update: 2017-04-17 13:10:23 UTC
README
安装
使用 Composer 安装,将以下依赖项添加到您的项目的 composer.json 文件中
{
"require": {
"loudclear/boxsuite-api": "~0.1"
}
}
然后通过以下方式安装
composer install
要使用绑定,请使用 Composer 的 自动加载
require_once('vendor/autoload.php');
API
请参阅完整文档http://docs.mobile7.apiary.io/
认证
几乎所有的 API 请求都应该在认证后完成。请在此处查看示例
$boxsuite = Boxsuite\Boxsuite::instance();
// Get list of existing accounts. account_id will be used for auth/login request
$accounts = $boxsuite->request('GET', 'auth/list_accounts', ['term' => 'alpha']);
// Authenticate
$session = $boxsuite->auth([
'username' => 'alpha1admin',
'password' => '1',
'account_id' => 36,
'remember' => 1
]);
$boxsuite->setSession($session);
// Check is user logged in
$is_logged_in = $boxsuite->isLoggedIn();
请求
请参阅 API 请求的示例
$manager_dasboard = $boxsuite->request('GET', 'manager/dashboard');
// Request with params
$sites = $boxsuite->request('GET', 'manager/get_sites', [
'user_id' => $user_id
]);
支持
如果您有任何问题或需要帮助集成,请通过 info@getboxsuite.com 联系我们
许可证
MIT 许可证。版权所有 2015 Get BoxSuite Pty Ltd. https://getboxsuite.com