Skip to content

Instantly share code, notes, and snippets.

@mir4a
Created April 11, 2013 06:40
Show Gist options
  • Save mir4a/5361235 to your computer and use it in GitHub Desktop.
Save mir4a/5361235 to your computer and use it in GitHub Desktop.
gettin access to hipchat api
<?php
$token = "ADMIN_TOKEN"; // replace with your admin token
$url = "https://api.hipchat.com/v1/users/list?auth_token=".$token; // this url gets all users and their attributes, for more info visit https://www.hipchat.com/docs/api/
$c = curl_init();
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); // required this for https access
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); // this one too
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($c); // return json data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment