Archives Posts
SimpleHighrise, a PHP wrapper class for the Highrise API
I have just began using some of the products from 37signals, including Ta-da List, Backpack, and Highrise (I also have a dormant Basecamp account).
Today I’d like to announce the first of many coding projects I’ll be posting at Activist Nerd: SimpleHighrise. This was inspired SimpleBackpack, the PHP wrapper class for Backpack, and much of the underlying utility code remains intact.
Download
SimpleHighrise.php, vAlpha
SimpleHighrise.php, vBeta
Disclaimer
This code comes no warranty, so use it at your own risk
What it doesn’t do [yet]
Error checking/handling- Update operations on objects listed in the Highrise API
What it does do
On all objects listed in the Highrise API:
- Show
- List
- Create
- Destroy
Please try it out and let me know any problems, issues, or ideas about SimpleHighrise!
Sample Usage
The following code instantiates a SimpleHighrise object. $result will hold the raw XML for all of the people the user can see:
include('simplehighrise.php');
$token = "token".":foo"; // tack on : (colon) and dummy password
$hr = new SimpleHighrise('user', $token);
$result = $hr->list_people();
echo $result;
Just as in SimpleBackpack, in order to return SimpleXML, do the following:
include('simplehighrise.php');
$token = "token".":foo";
$hr = new SimpleHighrise('username', $token, 'simplexml');
I’ll be adding to this as time progresses.
Update (24 Sep 2007): I posted vGamma, which has the following changes:
- Error handling: returns -1 if no results are returned from an op or if an op fails
- Better case support
- Miscellaneous bug fixes in handling different data types
Update (16 Aug 2007): I posted vBeta, which has the following changes:
- Added ability to return results as an array, using code from here. Here is an example:
include('simplehighrise.php');
$token = "token".":foo";
$hr = new SimpleHighrise('username', $token, 'array'); - Fixed search_people() and search_companies() to be able to return multiple people/companies (before, it was written to only return the1st person/company.
- Miscellaneous bug fixes.