Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors accessing the API #3

Open
chak opened this issue Jul 3, 2013 · 0 comments
Open

Errors accessing the API #3

chak opened this issue Jul 3, 2013 · 0 comments

Comments

@chak
Copy link

chak commented Jul 3, 2013

I am getting a 500 internal server error when trying to access the basic TaskRabbit API through the ruby gem, although I am able to do some API access using curl from the command line.

Here's my config:

Taskrabbit.configure do |config|
config.api_secret = 'XXX'
config.api_key = 'XXX'
config.base_uri = Rails.env.production? ? 'https://www.taskrabbit.com' : 'https://sandbox.taskrabbit.in'
config.endpoint = 'api/v2'
end

API_SECRET and API_KEY correspond to the Application Secret and Application ID obtained from the dev area of TaskRabbit. (I'm assuming Application ID == API Key here. If not, maybe that's the issue, but I don't see where to get the API Key if it's not the App ID.)

Then in rails console, I try this snippet from the documentation:
tr = Taskrabbit::Api.new
tasks = tr.tasks.all

Using the production base uri, I get this error:
Taskrabbit::Error: 412 Precondition Failed
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/client.rb:42:in check_response_errors' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/api_smith-1.0.0/lib/api_smith/client.rb:115:inrequest!'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/api_smith-1.0.0/lib/api_smith/client.rb:40:in get' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/api.rb:27:inrequest'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/task.rb:37:in all' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/proxy.rb:58:inload_found'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/proxy.rb:46:in proxy_found' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/proxy.rb:17:inall'
from (irb):2
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in start' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands/console.rb:8:instart'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands.rb:41:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `

'

Using the sandbox base uri, I get this error:

Taskrabbit::Error: 500 Internal Server Error
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/client.rb:42:in check_response_errors' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/api_smith-1.0.0/lib/api_smith/client.rb:115:inrequest!'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/api_smith-1.0.0/lib/api_smith/client.rb:40:in get' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/api.rb:27:inrequest'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/task.rb:37:in all' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/proxy.rb:58:inload_found'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/proxy.rb:46:in proxy_found' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/taskrabbit-0.1.0/lib/taskrabbit/proxy.rb:17:inall'
from (irb):3
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in start' from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands/console.rb:8:instart'
from /Users/dan/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands.rb:41:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `

'

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant