Git Product home page Git Product logo

hipchat-api's Introduction

HipChat API

Packagist Version MIT License

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 false on error by calling setThrowExceptions(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

hipchat-api's People

Contributors

g-rath avatar kaecyra avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hipchat-api's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.