vanilla/hipchat-api
Composer 安装命令:
composer require vanilla/hipchat-api
包简介
Hipchat v2 API client
README 文档
README
hipchat-api is a PHP library that provides an implementation of the HipChat v2 REST API.
Installation
hipchat-api requires PHP 5.4 or higher
hipchat-api is PSR-4 compliant and can be easily installed using composer.
Just add vanilla/hipchat-api to your composer.json.
"require": { "vanilla/hipchat-api": "~2.0" }
Usage
HipChat uses OAuth2 tokens with specific scopes to control API access. You can request a token for yourself by visiting the HipChat Account/API page.
<?php // The library lives in the HipChat namespace. use HipChat\v2\HipChatClient; // Require composer's autoloader. require_once 'vendor/autoload.php'; // Define the cli options. $client = new HipChatClient(); $client->setAuth('<OAUTH BEARER TOKEN>'); // Start making calls! $users = $client->usersAPI()->getAll();
This example makes a call to the Users API to get all users.
- You can make the client throw an exception instead of returning
falseon error by callingsetThrowExceptions(true)on$client.
Custom API Endpoint
If you are using a private instance of HipChat, you can change the API base URL when you instantiate the client:
<?php use HipChat\v2\HipChatClient; $client = new HipChatClient('https://my.hipchatdomain.com');
- You can also change the base URL at any time by calling
setBaseUrl()on an existing$client.
Current status
The following list shows methods available and missing:
###Add ons
- Get addon installable data
- Create addon link
- Invoke addon link
- Delete addon link
###Capabilities
- Get capabilities
###Emoticons
- Get emoticon
- Get all emoticons
###OAuth Sessions
- Generate token
- Get session
- Delete session
###Rooms
- Get all rooms
- Create room
- Get room
- Update room
- Delete room
- Get avatar
- Update avatar
- Delete avatar
- Get room message
- View room history
- View recent room history
- Get glance
- Create glance
- Delete glance
- Invite user
- Add member
- Remove member
- Get all members
- Get all participants
- Send message
- Send room notification
- Reply to message
- Share file with room
- Share link with room
- Get room statistics
- Set topic
- Get webhook
- Delete webhook
- Get all webhooks
- Create webhook
###Users
- Get all users
- Create user
- View user
- Update user
- Delete user
- View privatechat history
- View recent privatechat history
- Get private chat message
- Send message to user
- Get photo
- Upload photo
- Delete photo
- Get preference (auto-join)
- Share file with user
- Share link with user
统计信息
- 总下载量: 20.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-04