README.rdoc

A Ruby library for working with the Basecamp web-services API.

For more information about the Basecamp web-services API, visit:

http://developer.37signals.com/basecamp

You can find the original code in:

http://developer.37signals.com/basecamp/basecamp.rb

NOTE: not all of Basecamp's web-services are accessible via REST. This
library provides access to RESTful services via ActiveResource. Services
not yet upgraded to REST are accessed via the Basecamp class. Continue
reading for more details.

Installation

Install the gem

gem install basecamp

Include the system gems and require the library in your script

require 'rubygems'
require 'basecamp'

Dependencies

* activeresource >= 2.3.0
* xml-simple
* oauth2

Establishing a Connection

The first thing you need to do is establish a connection to Basecamp. This
requires your Basecamp site address and your login credentials or API
token.

Finding a Resource

Find a specific resource using the find method. Attributes of the
resource are available as instance methods on the resulting object. For
example, to find a message with the ID of 8675309 and access its title
attribute, you would do the following:

m = Basecamp::Message.find(8675309)
m.title # => 'Jenny'

To find all messages for a given project, use find(:all), passing the
project_id as a parameter to find. Example:

Note: You can access the API token using this object. This is useful if you
only have username/password and you want to use the API token in future
calls:

Basecamp::Person.me.token

To get all people by company:

Basecamp::Person.find(:all, :params => {:company_id => company.id})

To get all people by project:

Basecamp::Person.find(:all, :params => {:project_id => project.id})

Creating a Resource

Create a resource by making a new instance of that resource, setting its
attributes, and saving it. If the resource requires a prefix to identify it
(as is the case with resources that belong to a sub-resource, such as a
project), it should be specified when instantiating the object. Examples: