jorisvandesande/unifi-api-client
Composer 安装命令:
composer require jorisvandesande/unifi-api-client
包简介
Unifi API Client can be used to connect to the API of your Ubiquiti Unifi Controller
README 文档
README
Unifi API Client can be used to connect to the API of your Ubiquiti Unifi Controller. This client is build on top of Guzzle.
The code is tested against Unifi Controller version 4.6.6.
Installation
The API client can be installed with Composer:
composer require jorisvandesande/unifi-api-client
Or you can download the latest release at: https://github.com/jorisvandesande/unifi-api-client/releases
Usage
use JVDS\UnifiApiClient\Client; use GuzzleHttp\Client as HttpClient; $apiClient = new Client(new HttpClient(['base_uri' => 'https://127.0.0.1:8443'])); $apiClient->login('your_username', 'your_password'); // call supported methods via methods on the client $apiClient->statistics('default'); // or call any API url via the get and post methods: $apiClient->get('/api/self'); $apiClient->post('/api/s/default/cmd/stamgr', ['cmd' => 'block-sta', 'mac' => '01:01:01:01:01:01']); // logout $apiClient->logout();
Examples can be found in the examples directory. To run the examples, you must copy the config.example.php file to config.php and change the configuration to your needs.
Supported API calls
At the moment only a few API methods are implemented in the Client. Altough it is possible to use
the get() and post() methods of the Client to call any API url, the goal is to
support more methods.
License
MIT Licensed, see the LICENSE file.
统计信息
- 总下载量: 92
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-09