api - 如何在 postman 上发出 Yelp API GET 请求?

标签 api get postman yelp

我想使用 yelp api 并且我已从 Yelp 获取了访问 token 。我试图在 Postman 上发出 get 请求,但收到以下错误。

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

我的网址是 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

感谢您的帮助。

最佳答案

我也遇到了同样的问题。您遇到的问题是 Postman 的 UI 有点误导。您在应用程序的错误区域输入了搜索词,但应用程序和 API 都没有告诉您。

Image shows error state

解决此问题的方法是单击 URL 旁边的“参数”按钮,并为位置键添加键值对。

Image shows correct state

发生的情况是 Yelp 希望在查询字符串中而不是标题中添加搜索词,但 UI 会引导您将这些词添加为标题,但不会提示您查询字符串在其他地方已更改。

查看此问题页面以获取更多信息:https://github.com/Yelp/yelp-api/issues/193

关于api - 如何在 postman 上发出 Yelp API GET 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47643791/

相关文章:

ios - 来源 http ://localhost:8100 is not allowed by Access-Control-Allow-Origin in ionic

java - 为什么 System.out 设计笨拙?

perl - 当表单发布到我的脚本时,如何访问 URL 中传递的参数?

postman - 有没有办法在 Postman Collection 中的每个请求后运行测试脚本?

postman - NestJS 中的 FileInterceptor 和 Body 问题(在请求中上传文件和数据)

python - 如何在多个 Maya 网格中查找匹配顶点

python - IB TWS API - reqHistoricalData - keepUpToDate

php - 对于登录 GET 还是 POST?

java - 如何使用 google OAuth2 和 Java 向 script.google.com 网页发送 GET 请求?

c# - .NET Core Web API 中的图像上传