Module: SurveyMonkeyApi::Client::Surveys

Included in:
SurveyMonkeyApi::Client
Defined in:
lib/surveymonkey/client/surveys.rb

Overview

API endpoints for surveys resources

Instance Method Summary collapse

Instance Method Details

#survey(survey_id, options = {}) ⇒ Object

Returns surveys’s information



14
15
16
17
# File 'lib/surveymonkey/client/surveys.rb', line 14

def survey(survey_id, options = {})
    response = self.class.get("/v3/surveys/#{survey_id}", query: options)
    response.parsed_response
end

#survey_with_details(survey_id, options = {}) ⇒ Object

Returns surveys’s information with details



20
21
22
23
# File 'lib/surveymonkey/client/surveys.rb', line 20

def survey_with_details(survey_id, options = {})
    response = self.class.get("/v3/surveys/#{survey_id}/details", query: options)
    response.parsed_response
end

#surveys(options = {}) ⇒ Object

Returns list of surveys as array in [‘data’] field Each survey looks like href="https://api.surveymonkey.net/v3/surveys/120053599">api.surveymonkey.net/v3/surveys/120053599”, “nickname”=>“”, “id”=>“120053599”, “title”=>“Nyt”



8
9
10
11
# File 'lib/surveymonkey/client/surveys.rb', line 8

def surveys(options = {})
    response = self.class.get('/v3/surveys', query: options)
    response.parsed_response
end