mlinek/hipchat-v2-php

HipChat API integration for PHP

This package's canonical repository appears to be gone and the package has been frozen as a result.

0.1.0 2017-05-08 23:45 UTC

This package is not auto-updated.

Last update: 2019-12-13 15:18:18 UTC


README

Simple PHP library designed to help integrate HipChat v2 API. This library can be used for both, websites and to create HipChat add-ons.

Installation

composer require mlinek/hipchat-v2-php

Usage

Instantiate library

// Authorization method
$auth = new Bearer("<your access token>");

// HTTP client, implements HttpInterface, you can create your own implementation if you wish
$guzzle = new Guzzle("https://api.hipchat.com/");

// Client will configure the library on instantiation
$client = new ClientV2($auth, $guzzle);

Load rooms

// Make API call to load all rooms
$rooms = $client->rooms()->loadAll();

// Display first room name
echo $rooms[0]->name;

Load users

// Make API call to load all users
$users = $client->users()->loadAll();
echo $users[0]->mentionName; // mention_name is correct as well 

Load room participants by room id

// Instantiate Room model and set it's id to existing room's id
$room = new Room(['id' => 123]);

// Make API call to retrieve room's participants
$participants = $room->participants();

// Iterate over participants collection
foreach ($participants as $participant) {
    // $participant is a User model
    echo $participant->mentionName . ", ";
}

Endpoints Status

Capabilities

  • Get capabilities ✔
  • Get addon capabilities schema ✔

Emoticons

  • Get emoticon ✔
  • Get all emoticons ✔

Extensions

  • Get/create/delete global action ✘
  • Get/create/delete global dialog ✘
  • Get/create/delete global external page ✔
  • Get/create/delete global glance ✘
  • Get/create/delete global web panel ✘
  • Get/create/delete global webhook ✘

Groups

  • View group ✔
  • Get group avatar ✔
  • Update/delete group avatar ✘
  • Group statistics ✔

Integrations

  • Get integration installable data ✘
  • Invoke/create/delete integration link ✘
  • Addon ui update ✘
  • Room addon ui update ✘
  • User in room addon ui update ✘
  • User addon ui update ✘

Invites

  • Invite user to group ✘

OAuth session

  • Get/delete session ✘
  • Generate token ✔

Prefs public

  • Get auto join rooms ✘

Rooms

  • Get/update/delete room ✔
  • Get all rooms ✔
  • Get/create/delete room action ✘
  • Get/create/delete room dialog ✘
  • Get/create/delete room external page ✔
  • Get/create/delete room glance ✘
  • Get/create/delete room web panel ✘
  • Get/create/delete room webhooks ✔
  • Get room message ✔
  • View room history ✔
  • View recent room history ✔
  • Invite user ✔
  • Add/remove member ✔
  • Get all members ✔
  • Send message ✔
  • Send room notification ✔
  • Get all participants ✔
  • Reply to message ✔
  • Share file with room ✔
  • Share link with room ✔
  • Get room statistics ✔
  • Set topic ✔
  • Get all webhooks ✔
  • Get/create/delete webhook ✔

Users

  • Get all users ✔
  • Create/view/update/delete user ✔
  • Get privatechat message ✔
  • View privatechat history ✔
  • View recent privatechat history ✔
  • Private message user ✔
  • Get/update/delete photo ✘
  • Get auto join rooms ✘
  • Share file with user ✔
  • Share link with user ✔