我正在尝试将 YELP API 集成到 Android Studio 的应用程序中。我正在尝试使用 Postman 中的 post 请求获取访问令牌。但是,当我发送 post 请求时,我以 JSON 格式返回此错误:
{
"error": {
"code": "VALIDATION_ERROR",
"description": "'client_credentials' is not one of ['authorization_code', 'refresh_token']",
"field": "grant_type",
"instance": "client_credentials"
}
}
我已经在这个网站和谷歌上搜索过描述行的具体含义:
"description": "'client_credentials' is not one of ['authorization_code', 'refresh_token']",
我无法找到有关此错误含义的任何结果。这是我在邮递员中的项目设置:
我只是简单地从 yelp 复制并粘贴我的客户端 ID 和 API 密钥,并将它们分别存储在 Postman 的 client_id 和 client_secret 中。当我发送这个请求时,我收到 400 Bad Request 错误并发现它是一个验证错误。一开始我以为是我输入了错误的API key,但是我刷新了API key,直接复制粘贴了,所以我确信我的API key和client ID是正确的。输出应如下所示,并应提供访问令牌:
我找不到任何包含此特定错误消息的示例。
您不再需要刷新令牌,您只需要 Authorization 标头中的 API 密钥:
Authorization: Bearer {{apiKey}}
来源:https : //www.yelp.com/developers/documentation/v3/authentication
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句