3

I am building a web app using rails and using the yelp api through yelp api gem. The api was working until yesterday, I got this error:

Yelp::Error::InvalidParameter - One or more parameters are invalid in request

I haven't changed any code.

Here is my yelp service :

require 'yelp'
class YelpService
    def get_detail(id)
        begin
            yelp_client = Yelp::Client.new({ consumer_key: 'my-consumer-key',
                            consumer_secret: 'mysecret',
                            token: 'my-token',
                            token_secret: 'mytoken-secret'
                          })  
            Rails.logger.info "yelp client #{yelp_client}"
            Rails.logger.info "id #{id}"
            yelp_response = yelp_client.business(id)
            Rails.logger.info "yelp response #{yelp_response}"
            if yelp_response
                return yelp_response.rating_img_url
            else
                Rails.logger.info "Error in yelp client call"
            end 
        rescue Exception => e
            # Mandrill errors are thrown as exceptions
            Rails.logger.info "Error occurred in yelp service: #{e.class} - #{e.message}"
            return "none"
        end 
    end 
  private
    attr_reader :id 
end

I have tried changing the mandrill key, but with no effect. Please help me resolve this issue.

Yash
  • 4,775
  • 3
  • 26
  • 59

1 Answers1

-1

have tried this to locate where exactly the error is

https://codeclimate.com/github/Yelp/yelp-ruby/Yelp::Error::InvalidParameter

Mourad
  • 464
  • 3
  • 10