Basecamp API Rails

Posted by dannymcc on Stack Overflow See other posts from Stack Overflow or by dannymcc
Published on 2010-06-10T21:20:11Z Indexed on 2010/06/10 21:22 UTC
Read the original article Hit count: 407

Filed under:
|
|
|

Hi Everyone,

I was wondering if someone could do me massive favour..

I really don't understand how to make use of API's - so I was wondering if, using Basecamp as an example, someone could talk me though the basics.

So far I have an application with a dashboard controller/view, I have put basecamp.rb into my /lib directory, added the following to my application_controller:

  def basecamp_connect
    Basecamp.establish_connection!('XXXXXX.basecamphq.com', 'USER', 'PASS', false)
    @basecamp = Basecamp.new
  end

Obviously changing the required parts to my credentials.

Next up I have added the following to my dashboard_controller:

  def index
    Basecamp::TodoList.find(:all)
  end

Next I presume I have to somehow list the Todo's on the dashboard using some sort of loop.

Am I doing the right thing, if so - how on earth do I display all the todo items and if not - what am I doing wrong/missing.

It doesn't have to be todo's, anything from basecamp or any other popular API service would be a good start. It's just that I happen to have a basecamp account!

Thanks,

Danny

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about api