jsmestad / pivotal-tracker

Ruby gem that provides an AR-style interface for the Pivotal Tracker API
http://github.com/jsmestad/pivotal-tracker
MIT License
351 stars 184 forks source link

The call project.stories.all fails with a 400 Bad Request #95

Open shyam-habarakada opened 10 years ago

shyam-habarakada commented 10 years ago

in an irb console,

TOKEN = 'a-token'
PROJECT_ID = 123
require 'pivotal-tracker'
PivotalTracker::Client.token = TOKEN
project = PivotalTracker::Project.find(PROJECT_ID)
project.stories.all

Error

RestClient::BadRequest: 400 Bad Request
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
  from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:745:in `start'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/rest-client-1.6.7/lib/restclient/resource.rb:51:in `get'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/pivotal-tracker-0.5.12/lib/pivotal-tracker/story.rb:8:in `all'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/pivotal-tracker-0.5.12/lib/pivotal-tracker/proxy.rb:60:in `load_found'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/pivotal-tracker-0.5.12/lib/pivotal-tracker/proxy.rb:48:in `proxy_found'
  from /usr/local/rvm/gems/ruby-1.9.3-p125@benchpress-server-2/gems/pivotal-tracker-0.5.12/lib/pivotal-tracker/proxy.rb:15:in `all'
  from (irb):29
  from /usr/local/rvm/rubies/ruby-1.9.3-p125/bin/irb:12:in `<main>'
ghost commented 10 years ago

Same here.

mremond commented 10 years ago

Try switching to ssl:

PivotalTracker::Client.use_ssl = true