2

I wanted to use yelp api and I have obtained the access token from Yelp. I was trying to make a get request on Postman and I was getting the following error.

{
    "error": {
        "code": "VALIDATION_ERROR",
        "description": "Please specify a location or a latitude and longitude"
    }
}

My Url is https://api.yelp.com/v3/businesses/search

I am passing term, location and authorization in header field. I even tried to pass latitude and longitude, I am still getting the same error

Thank you for your help.

Danny Dainton
  • 15,673
  • 4
  • 40
  • 52

1 Answers1

3

I had this exact same problem. The issue you're running into is Postman's UI is a bit misleading. You're entering your search terms in the wrong area in the application, but neither the application nor the API is telling you.

Image shows error state

The way to fix this is to click the "Params" button next to the URL, and to add a key value pair for the location key.

Image shows correct state

What's happening is Yelp wants search terms in the query string, not the headers, but the UI is leading you to add the terms as headers and not cluing you in that the query string is altered elsewhere.

Check out this issue page for more info: https://github.com/Yelp/yelp-api/issues/193

Danny Dainton
  • 15,673
  • 4
  • 40
  • 52