I am just starting out with OAuth and I was trying to make a small client to connect to some web services ... I tried twitter and it worked like a charm, however I also tried to access the Yelp V2 API (after their Python example), but I always come back to answers: HTTP 400 Bad Request
Missing parameter: oauth_consumer_key
Here is my code:
require 'rubygems' require 'oauth' CONSUMER_KEY = "MY_CONSUMER_KEY" SECRET = "MY_CONSUMER_SECRET" TOKEN = "MY_TOKEN" TOKEN_SECRET = "MY_TOKEN_SECRET" consumer = OAuth::Consumer.new( CONSUMER_KEY,SECRET, {:site => "http://api.yelp.com", :signature_method => "HMAC-SHA1", :scheme => :header}) access_token = OAuth::AccessToken.new( consumer, TOKEN,TOKEN_SECRET) p access_token.get("/v2/search?location=new+york").body
Regardless of the fact that this code works with twitter API without any problems (I really followed the example of Twitter code)
Greetings and thanks in advance, Ze
source share