Recent Posts by Klondike

Feb 29, 2008
Avatar Klondike 2 posts

Topic: Basecamp API / 302 When adding time to a Todo list task

Hi! I’m trying to do the exact same thing as you (extend the Ruby wrapper to include time tracking). I was having your problem at first, and when I combined what I had with what you had, I no longer got the 203. Then I was getting a 422 error, which turned out to be caused by using dashes instead of hyphens.

Here’s my winning method:

def log_time(project_id, person_id, date, hours, description = nil, todo_item_id = nil)
    entry = {"project_id" => project_id, "person_id" => person_id, "date" => date.to_s, "hours" => hours.to_s}
    entry["description"] = description if description
    entry["todo_item_id"] = todo_item_id if todo_item_id
    record "/time/save_entry", :entry => entry
end

Does this help? I placed some “puts” and “p” debug lines into basecamp.rb to see what was being POSTed and the response body returned, that helped me debug this a lot.

def post(path, body, header={})
      puts "POSTing:" 
      p YAML.load(body)

...

def request(path, parameters = {}, second_try = false)
    response = post(path, convert_body(parameters), "Content-Type" => content_type)

    puts "Reponse:" 
    puts response.body

 
Nov 19, 2007
Avatar Klondike 2 posts

Topic: Campfire / Recent technical issues

Can anybody comment on the technical issues plaguing Campfire earlier today, and the similar unreliability issues occuring last week? We suffered disruption at work from it on both occasions, and so began flirting with…IRC!! I could weep. Help!