diff --git a/HipChat.php b/HipChat.php index cf109a5..ac93d3a 100644 --- a/HipChat.php +++ b/HipChat.php @@ -103,6 +103,18 @@ public function message_room($room_id, $from, $message, $notify = false, $color return ($response->status == 'sent'); } + /** + * Get chat history for a room + * + * @see https://www.hipchat.com/docs/api/method/rooms/history + */ + public function get_rooms_history($room_id, $date = 'recent') { + $response = $this->make_request('rooms/history', array( + 'room_id' => $room_id, + 'date' => $date + )); + return $response->messages; + } ///////////////////////////////////////////////////////////////////////////// // User functions