Skip to main content

get_survey

GET /surveys/:id

Get a single survey

require 'rest-client'

survey_id = 'PUT-YOUR-SURVEY-ID-HERE'

RestClient::Request.execute method: :get,
url: "https://api.diduenjoy.com/api/v1/surveys/#{survey_id}",
user: 'PUT-YOUR-API-KEY-HERE'

# => {
# data: {
# type: "surveys",
# id: "YOUR-SURVEY-ID",
# attributes: {
# created_at: "2016-01-12 17:14:53 UTC",
# updated_at: "2016-01-12 17:14:59 UTC",
# name: "Satisfaction Survey 1",
# hash: "dd2d2ddd2d"
# },
# relationships: {
# company: {
# data: {
# type: "companies",
# id: "YOUR-COMPANY-ID",
# links: {
# self: "http://localhost:3000/api/v1/companies/YOUR-COMPANY-ID"
# }
# }
# },
# survey_languages: {
# data: [
# {
# type: "survey_languages",
# id: "FIRST-SURVEY_LANGUAGE-ID",
# links: {
# self: "http://localhost:3000/api/v1/survey_languages/FIRST-SURVEY_LANGUAGE-ID"
# }
# },
# {
# type: "survey_languages",
# id: "SECOND-SURVEY_LANGUAGE-ID",
# links: {
# self: "http://localhost:3000/api/v1/survey_languages/SECOND-SURVEY_LANGUAGE-ID"
# }
# }
# ]
# }
# },
# links: {
# self: "http://localhost:3000/api/v1/surveys/YOUR-SURVEY-ID"
# }
# }
# }

attributes

attributedescription
created_at
datetime
survey creation date
updated_at
datetime
survey last modification date
name
string
survey name
status
boolean
survey status ('Live','deleted','archived')
qr_hash
string
survey public hash, used with companies custom mailing systems
available_locales
array
survey's available languages (ISO-Code & language name)

relationships

relationshipdescription
companycompany owning the survey
survey_languagessurvey localized texts (at least 1)