API Documentation

Authentication

The HipChat API requires you to pass an auth_token variable with each request containing one of your API tokens. If the token is not provided or invalid you will receive a 401 response.

Where do I get a token?

Group admins may create them on the API Tokens page.

Wire format

For example, if your token were 'abc123', a request would look like:

GET /v1/rooms/list?auth_token=abc123 HTTP/1.1 Host: api.hipchat.com

Which would generate the response:

HTTP/1.1 200 OK Date: Tue, 13 Apr 2010 22:16:11 GMT Content-Type: application/json Vary: Accept-Encoding Content-Length: 90 Connection: close {"rooms":[{"room_id":5,"name":"Engineering", "last_active":1271190087,"owner_user_id":10}]}

Note: auth_token may be passed in the POST data when making a POST request.

Usage examples

cURL

curl http://api.hipchat.com/v1/rooms/list?auth_token=token

Perl

use strict; use warnings; use WWW::Curl::Easy; my $url = "http://api.hipchat.com/v1/rooms/list?auth_token=token"; my $response; my $result; my $curl = new WWW::Curl::Easy; $curl->setopt(CURLOPT_URL, $url); open (my $fileb, ">", \$response); $curl->setopt(CURLOPT_WRITEDATA, $fileb); $result = $curl->perform(); print($response);

PHP

// using standard curl extension $url = "http://api.hipchat.com/v1/rooms/list?auth_token=token"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); echo curl_exec($c);

Python

import urllib2 url = "http://api.hipchat.com/v1/rooms/list?auth_token=token" request = urllib2.Request(url) response = urllib2.urlopen(request) print response.read()

Ruby

require 'net/http' require 'uri' url = "http://api.hipchat.com/v1/rooms/list?auth_token=token" puts Net::HTTP.get(URI.parse(url))

Note: We suggest using an existing client library to work with the API.