Search code examples
iosyelp

Yelp API invalid Signature


I am sending request to yelp api to search place providing latitude and longitude but it giving me following error

    error =     {
    description = "Invalid signature. Expected signature base string: GET&http%3A%2F%2Fapi.yelp.com%2Fv2%2Fsearch&ll%3D37.77493%252C-122.419415%26oauth_consumer_key%XXXXXXXXXXXX%26oauth_nonce%3D1D3331BF-4570-45E5-8DD0-5B85842E42E7%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1409214229%26oauth_token%XXXXXXXXXXXX%26oauth_version%3D1.0%26radius_filter%3D300%26term%3Dcafe";
    id = "INVALID_SIGNATURE";
    text = "Signature was invalid";
                 };

http://api.yelp.com/v2/search?term=%@&ll=37.77493,-122.419415&radius_filter=300

This is my sample request, am i doing it wrong.


Solution

  • You have to authenticate using OAuth first.

    Documentation: http://www.yelp.com/developers/documentation/v2/authentication

    You should use a library for authenticating with OAuth if you don't want to do a lot of work. For example, in python: http://letstalkdata.com/2014/02/how-to-use-the-yelp-api-in-python