Yelp android studio VALIDATION_ERROR

问题描述 投票:0回答:1

我正在尝试将YELP API集成到Android Studio中的应用程序中。我试图在邮递员中使用帖子请求获取访问令牌。但是,当我发送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']",

我无法找到任何关于此错误意味着什么的结果。这是邮递员的项目设置:

enter image description here

我只是从yelp复制并粘贴我的客户端ID和API密钥,并将它们分别存储在Postman中的client_id和client_secret中。当我发送此请求时,我收到400错误请求错误,并发现它是一个验证错误。起初我以为我输入了错误的API密钥,但是,我刷新了API密钥并直接复制并粘贴它,所以我确信我的API密钥和客户端ID是正确的。输出应该如下所示,它应该提供访问令牌:

enter image description here

我找不到任何具有此特定错误消息的示例。

java android postman yelp yelp-fusion-api
1个回答
1
投票

您不再需要刷新令牌,您只需要在Authorization标头中使用API​​密钥:

Authorization: Bearer {{apiKey}}

资料来源:https://www.yelp.com/developers/documentation/v3/authentication

© www.soinside.com 2019 - 2024. All rights reserved.