我正在尝试通过PostMan使用API来获取调查id。
我已经生成了以下请求,但我仍然无法获得调查id。
请求1:-
GET - https://api.surveymonkey.com/oauth/authorize?
with below parameter passed-
response_type = code
redirect_uri = <<OAUTH_REDIRECT_URL>>
client_id = <<CLIENT_ID>>
请求2:-
POST - https://api.surveymonkey.com/oauth/token
with below parameters passed-
client_id = <<CLIENT_ID>>
client_secret = <<SECRET_KEY>>
code = <<ACCESS_TOKEN>>
grant_type = authorization_code
redirect_uri = <<OAUTH_REDIRECT_URL>>
然而,在第二次请求之后,我得到了以下错误-
{
"error_description": "Missing required parameter(s): client_id, client_secret, code, grant_type, redirect_uri",
"error": "invalid_request"
}
如果我错过了什么,请给我提个醒。
发布于 2019-03-15 01:40:48
在第一个GET请求中,我假设所有3个参数都被SurveyMonkey识别并正确解析,因为您没有收到错误消息。
在第二个POST请求中,我假设所有参数都无法识别,因为错误消息显示所有参数都丢失。
这向我建议GET和POST请求使用不同的方法来传递它们的参数。
此answer提到,使用传递参数的GET方法将不适用于POST请求。
上面的答案有一个Node.JS web服务客户端实现。如果你正在使用PHP/CURL堆栈,你可以尝试复制这个implementatin。
https://stackoverflow.com/questions/55168402
复制相似问题