Closed ghost closed 8 years ago
Here's some relevant logger output - at face value, it looks like the arguments aren't getting passed from get_responses
to post
.
[2016-04-28T09:56:22] DEBUG surveymonkey: initialize: api_method: get_responses
[2016-04-28T09:56:22] DEBUG surveymonkey: initialize: args: [{"survey_id"=>67965837, "respondent_ids"=>["4673037086", "4673032990", "4673028893"]}]
...
[2016-04-28T09:56:22] DEBUG surveymonkey: api_method: path '/v2/surveys/get_responses'
[2016-04-28T09:56:22] DEBUG surveymonkey: api_method: method 'post'
[2016-04-28T09:56:22] DEBUG surveymonkey: initialize: enter
[2016-04-28T09:56:22] DEBUG surveymonkey: initialize: the_method: 'post' (was 'post')
[2016-04-28T09:56:22] DEBUG surveymonkey: initialize: method: post
[2016-04-28T09:56:22] DEBUG surveymonkey: api_method_params: parsing api method params from '{}'
[2016-04-28T09:56:22] DEBUG surveymonkey: api_method_params: parsed method params '{}'
I think I've narrowed the problem down a bit. When calling request.new
, @method_params
is not being assigned:
# This is is an empty hash when calling get_responses with call shown above
@method_params = api.api_method_params(param_hash.fetch('method_params', {}))
I'm able to circumvent this by adding method_params
as a key to the original options hash:
# Hey, this works!
Surveymonkey.get_responses('method_params' => {'survey_id'=>'67965837', 'respondent_ids'=>['4673037086']})
Is this the intended behavior? If not, I can dig a little deeper and try to fix it.
hi @cescue! i can tell you two things:
method_params
as a key to the options hash) everywhere, and so i can confirm that that results in the desired behaviori like your fix in #5, and i'm going to merge it; i just want to take a moment to determine whether i'll need to indicate that i'm breaking backwards compatibility.
thanks again! 👍 require ~> 1
to avoid this nonsense in the future
I'm able to retrieve a list of surveys with the following call:
Similarly, I'm able to retrieve a list of respondents to a given survey with this call:
However, when I try to retrieve the responses with this call:
I get the following error:
Am I missing something obvious, or is the
get_responses
method not working as intended?