[英]Get URL for Yelp fusion API
I'm attempting to create a url for the Yelp search API endpoint, but can't seem to get the parameters right.我正在尝试为 Yelp 搜索 API 端点创建一个 url,但似乎无法获得正确的参数。 I'm pretty new at this, so this is probably a simplistic thing, but I can't find any tutorials on how to create the url.我对此很陌生,所以这可能是一件简单的事情,但我找不到任何关于如何创建 url 的教程。
I've created my API key, but again, the parameters are incorrect.我已经创建了我的 API 密钥,但参数还是不正确。
This is the url I have:这是我的网址:
https://api.yelp.com/v3/businesses/search?accessToken=API_KEY&term=food
The JSON output I am recieving is this:我收到的 JSON 输出是这样的:
{"error": {"code": "VALIDATION_ERROR", "description": "Authorization is a required parameter.", "field": "Authorization", "instance": null}}
What is the correct url I should be using?我应该使用的正确网址是什么?
Your link does not include an access token.您的链接不包含访问令牌。 To authenticate you must get a private API Key that is automatically generated.要进行身份验证,您必须获得自动生成的私有 API 密钥。 That is why the error is showing.这就是显示错误的原因。
There is no connection between the authorization and the API.授权和API之间没有任何联系。 I would suggest using Postman to query.我会建议使用Postman来查询。
You can set up a bearer token using the token given to you by yelp.您可以使用 yelp 提供给您的令牌设置不记名令牌。 This way you can use the Postman tool to query.这样就可以使用Postman工具来查询了。
Docs: https://www.yelp.com/developers/documentation/v3/get_started文档: https ://www.yelp.com/developers/documentation/v3/get_started
I think you need to have the authorization value as Bearer in the headers with your request我认为您需要在请求的标头中将授权值作为 Bearer
I am new to programming but I saw a beautiful error resolution just now and would like to tell you about it.我是编程新手,但我刚才看到了一个漂亮的错误解决方案,想告诉你。
My error has resolved after I had corrected the spelling of Authorisation as Authorization.在我将 Authorization 的拼写更正为 Authorization 后,我的错误已解决。 (With z in it instead of s). (用 z 而不是 s)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.