public
Description: PHP Wrapper for the 37 Signals Basecamp API
Homepage: http://www.quirkey.com/blog/basecamphp/
Clone URL: git://github.com/quirkey/basecamphp.git
commit  12c784871bcd8b0d62eb70bb09eb3588ddb107d3
tree    ff4b5ff643e8606edc573185acf25c7b716c459d
parent  03962bafe9bd58d46ca825d71dfb21b2fcbb4b8a
basecamphp / README
100644 86 lines (52 sloc) 2.505 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
###################################################
 
THE BASECAMP API PHP WRAPPER
 
coded by Aaron Quint
--> http://www.quirkey.com/blog/
based on basecamp.rb by 37signals
--> http://www.37signals.com
 
the latest code now lives at github:
--> http://github.com/quirkey/basecamphp/
 
 
####################################################
 
 
INTRODUCTION
 
The Basecamp API is an XML REST interface for interacting with
37 signals Basecamp Project management software.
The PHP wrapper is an implementation of the API as a PHP 4 class.
 
API documentation:
http://www.basecamphq.com/api
 
REQUIREMENTS
 
basecamp.php requires a couple of classes from PEAR. Specifically
 
HTTP_Request
XML_Serializer
 
which can be found (with documentation) at http://pear.php.net
These are really easy to install (if you have access to a command line)
 
$ sudo pear install HTTP_Request
$ sudo pear install XML_Serializer-0.18.0
 
The version number is necessary for XML_Serializer because its not yet a stable release.
If you get any messages while trying to install like 'Dependencies failed', just do
 
$ sudo pear upgrade _Missing_Package_
 
!!! VERY IMPORTANT !!!
In order for this to work you need to enable API access on your Basecamp account.
The owner of the account has to do this in Basecamp > Settings.
 
USAGE
 
Its real easy to get stuff and send stuff to your Basecamp account.
First, initialize a Basecamp object with your credentials:
 
$session = new Basecamp('myusername','mypassword','http://mybasecamp.baseurl.com');
 
Then its just a matter of calling the api function on the session.
(see the internal documentation for more info).
 
// Get all your projects
 
// initialize
$session = new Basecamp('myusername','mypassword','http://mybasecamp.baseurl.com');
// get the projects
$projects = $session->projects();
 
// get all the lists from your project
$lists = $session->lists($projects[0]->id);
 
Because everything returned is an object (or an array of objects) its easy to arrange projects:
 
$my_project = $projects[0];
$my_project->messages = $session->message_archive($my_project->id);
 
You should reference the API docs (http://www.basecamphq.com/api) for all the details of the
different Basecamp object types. Or you can always use the magical print_r function:
 
print_r($projects);
 
 
 
Please send any comments, correction, bugs to aq at audiokio dot com.
If you like this script - subscribe to my blog:
http://www.quirkey.com/blog/
There are bunch of other projects in the works . . .