Questions
Artur Zbiejcik avatar
Written by Artur Zbiejcik
Updated over a week ago

List of operations for a resource

Name

URL

Description

/questions/:id_survey/:id_page

Returns a list of questions for a survey with a specified ID.

Response parameter description

Name/path

Description

Possible values

id

Question ID

id_page

ID of the page where the question is located

number

Question number

type

Question type

0 – Single choice
1 – Single matrix
2 – Descriptive
3 – Awarding points
4 – Form
5 – Ranking
6 – Multiple choice
7 – Multiple matrix
8 – Slider
9 – Descriptive block
10 – Number
11 – Email
12 – Date
13 – Drop-down list
14 – GDPR Clause
15 – File upload
16 – NPS
17 – Open matrix
19 – Drag and drop
20 – Rating

date_created

Date of creating a question

date_modified

Date of last question edit

text

Question content

desc

Question description

required

Flag informing whether the questions is mandatory

true – mandatory question
false – non-mandatory question

answers_count

Number of answers in a question

options.long_answer

A flag indicating whether the descriptive question should have a place for a long text of the answer. Parameter only visible for a descriptive question

true – long answer text
false – short answer text

options.min

For multiple-choice questions: the minimum number of answers selected
In questions about date: the oldest date to choose from when filling out
In question about number: the minimum possible value when filling out. If the value is undefined then null will be returned

0 – number in the specified format
dd-mm-yyyy – date in the specified format
null – if the value is undefined

options.max

For multiple-choice questions: the maximum number of answers selected
In questions about date: the youngest date to choose from when filling out
In question about number: the maximum possible value when filling out. If the value is undefined then null will be returned

0 – number in the specified format
dd-mm-yyyy – date in the specified format
null – if the value is undefined

options.shuffle_answers

A flag indicating whether the order in which the answers (cafeteria) should be displayed is random

The order draw should be done on the customer's application side. Regardless of this flag, the API will always return these responses in the same order.

Information available for questions: single choice, multiple choice, single choice matrix, multiple choice matrix, ranking, form, slider, drop-down list, drag and drop

true – random order of displaying answers
false – fixed order of displaying answers

options.horizintal_display

Flag indicating whether responses should be displayed side by side (Horizontal orientation of displaying responses)

Information available for questions: single choice and multiple choice.

true – horizontal orientation of displaying responses
false – vertical orientation of displaying responses

options.range_positions_number

The number of slider positions. Only available in a slider question.

answers.*

Answers in a question (cafeteria). Field present in questions: single choice, multiple choice, single choice matrix, multiple choice matrix, ranking, form, drop-down list, drag and drop

Array

answers.text

Response content

answers.custom_response_available

A flag informing whether it is possible to specify a custom response to a given question

true – custom response available
false – custom response unavailable

answers.required

Flag indicating whether the field in the response is mandatory. The parameter is available only for a form type question

true – filling out the form field is mandatory
false – filling out the form field is not mandatory

scales.*

Successive scale items (fixed) available for questions: single choice matrix, multiple choice matrix , open matrix, drag and drop

Array

scales.text

Scale label content

ranges.*

The extreme labels of a smooth scale, only available for the slider questions

Array

ranges.left

Text to the left of the scale

ranges.right

Text to the right of the scale

List of questions

URL

(GET) https://www.startquestion.com/api/v2/questions/:id_survey/:id_page

Parameters (GET)

Name

Description

id_survey

ID of the survey containing questions. Mandatory parameter

id_page

ID of the page containing questions. The page must belong to the survey (id_survey). Optional parameter

Sample response

[
{
"id":782299,
"id_page":258355,
"number":1,
"type":0,
"date_created":"2011-07-14 22:24:46",
"date_modified":"2011-12-29 18:04:24",
"text":"Jednokrotne",
"desc":"",
"required":1,
"answers_count":3,
"options":{
"shuffle_answers":false,
"horizontal_display":false
},
"answers":[
{
"text":"tak",
"custom_response_available":false
},
{
"text":"nie",
"custom_response_available":false
},
{
"text":"inne",
"custom_response_available":true
}
]
},
{
"id":782300,
"id_page":258355,
"number":2,
"type":6,
"date_created":"2011-07-14 22:24:58",
"date_modified":"2011-12-29 18:04:13",
"text":"Wielokrotne",
"desc":"",
"required":1,
"answers_count":4,
"options":{
"min":2,
"max":2,
"shuffle_answers":false,
"horizontal_display":false
},
"answers":[
{
"text":"tak",
"custom_response_available":false
},
{
"text":"nie",
"custom_response_available":false
},
{
"text":"mo\u017ce",
"custom_response_available":false
},
{
"text":"inne",
"custom_response_available":true
}
]
},
{
"id":782301,
"id_page":258355,
"number":3,
"type":1,
"date_created":"2011-07-14 22:25:10",
"date_modified":"2011-12-29 18:04:04",
"text":"macierzowe jednokrotne",
"desc":"",
"required":1,
"answers_count":2,
"options":{
"shuffle_answers":false
},
"answers":[
{
"text":"ola"
},
{
"text":"jola"
}
],
"scales":[
{
"text":"tak"
},
{
"text":"nie"
}
]
},{
"id":782302,
"id_page":258355,
"number":4,
"type":7,
"date_created":"2011-07-14 22:25:27",
"date_modified":"2011-12-29 18:03:54",
"text":"macierzowe wielokrotne",
"desc":"Podaj kolor oczu",
"required":1,
"answers_count":4,
"options":{
"shuffle_answers":false
},
"answers":[
{
"text":"ola"
},
{
"text":"jola"
},
{
"text":"ala"
},
{
"text":"zuza"
}
],
"scales":[
{
"text":"niebieski"
},
{
"text":"zielony"
},
{
"text":"piwny"
}
]
},
{
"id":782303,
"id_page":258355,
"number":5,
"type":2,
"date_created":"2011-07-14 22:25:36",
"date_modified":null,
"text":"otwarte",
"desc":"",
"required":1,
"answers_count":1,
"options":{
"long_answer":false
}
},
{
"id":782304,
"id_page":258355,
"number":6,
"type":5,
"date_created":"2011-07-14 22:25:52",
"date_modified":null,
"text":"Pytanie rankingowe",
"desc":"",
"required":1,
"answers_count":3,
"options":{
"shuffle_answers":true
},
"answers":[
{
"text":"jeden"
},
{
"text":"dwa"
},
{
"text":"trzy"
}
]
},
{
"id":782305,
"id_page":258355,
"number":7,
"type":4,
"date_created":"2011-07-14 22:26:04",
"date_modified":"2011-12-29 18:04:59",
"text":"Formularz",
"desc":"",
"required":0,
"answers_count":4,
"options":{
"shuffle_answers":false
},
"answers":[
{
"text":"Imi\u0119",
"required":false
},
{
"text":"Nazwisko",
"required":false
},
{
"text":"PESEL",
"required":true
},
{
"text":"Telefon",
"required":true
}
]
},
{
"id":782306,
"id_page":258355,
"number":8,
"type":8,
"date_created":"2011-07-14 22:26:27",
"date_modified":null,
"text":"Dyferencja\u0142",
"desc":"",
"required":1,
"answers_count":2,
"options":{
"shuffle_answers":false,
"range_positions_number":6
},
"ranges":[
{
"left":"\u017ale",
"right":"dobrze"
},
{
"left":"smutno",
"right":"weso\u0142o"
}
]
},
{
"id":819543,
"id_page":258355,
"number":9,
"type":13,
"date_created":"2011-12-29 16:56:00",
"date_modified":null,
"text":"Lista rozwijanla",
"desc":"",
"required":1,
"answers_count":4,
"options":{
"shuffle_answers":true
},
"answers":[
{
"text":"jeden"
},
{
"text":"dwa"
},
{
"text":"trzy"
},
{
"text":"cztery"
}
]
},
{
"id":819544,
"id_page":258355,
"number":10,
"type":10,
"date_created":"2011-12-29 16:57:27",
"date_modified":"2011-12-29 18:03:18",
"text":"Pytanie o liczb\u0119",
"desc":"Dodatkowy opis pytania o liczb\u0119",
"required":1,
"answers_count":1,
"options":{
"min":null,
"max":10
}
},
{
"id":819545,
"id_page":258355,
"number":11,
"type":11,
"date_created":"2011-12-29 16:57:48",
"date_modified":null,
"text":"Pytanie o e-mail",
"desc":"",
"required":1,
"answers_count":1
},
{
"id":819546,
"id_page":258355,
"number":12,
"type":12,
"date_created":"2011-12-29 16:58:07",
"date_modified":null,
"text":"Pytanie o dat\u0119",
"desc":"",
"required":1,
"answers_count":1,
"options":{
"min":"01-12-2011",
"max":"29-02-2012"
}
},
{
"id":1955652,
"id_page":258355,
"number":13,
"type":16,
"date_created":"2014-10-04 15:32:36",
"date_modified":"2014-10-17 16:36:39",
"text":"Na ile by\u0142by\u015b w stanie poleci\u0107 nasze us\u0142ugi swoim znajomym?",
"desc":"",
"required":1,
"answers_count":11,
"options":{
"left_scale":"Zdecydowanie nie polec\u0119",
"right_scale":"Zdecydowanie polec\u0119",
"justification":"Uzasadnij swoj\u0105 odpowied\u017a"
},
"answers":[
{
"text":"0",
"custom_response_available":true
},
{
"text":"1",
"custom_response_available":true
},
{
"text":"2",
"custom_response_available":true
},
{
"text":"3",
"custom_response_available":true
},
{
"text":"4",
"custom_response_available":true
},
{
"text":"5",
"custom_response_available":true
},
{
"text":"6",
"custom_response_available":true
},
{
"text":"7",
"custom_response_available":true
},
{
"text":"8",
"custom_response_available":true
},
{
"text":"9",
"custom_response_available":true
},
{
"text":"10",
"custom_response_available":true
}
]
},
{
"id":1955653,
"id_page":258355,
"number":14,
"type":19,
"date_created":"2011-07-14 22:25:10",
"date_modified":"2011-12-29 18:04:04",
"text":"przeciągnij i upuść",
"desc":"",
"required":1,
"answers_count":2,
"options":{
"shuffle_answers":false
},
"answers":[
{
"text":"morska kąpiel"
},
{
"text":"narty w górach"
}
],
"scales":[
{
"text":"lato"
},
{
"text":"zima"
}
]
},
]


Returned errors

  • 400 Bad request – Incorrect parameters, survey ID :id_survey does not contain page ID :id_page.

  • 401 Unauthorized – The user refers to a foreign resource – a survey that is not their property.

  • 404 Not Found – No survey with specified ID :id_survey was found.

  • 406 Not Acceptable – The :id_survey parameter was not provided.

Did this answer your question?