GET api/v1/questions/:questionnaire_id/questions/:id
Question details
The following question fields are returned:
- id
-
unique identifier of a question
- section_id
-
identifier of section
- looping_section_id
-
identifier of closest looping section. When present, question is looping and looping_contexts need to be processed to retrieve answers.
- url
-
API URL path of question details
- title
-
title of the question (translated where available)
- language
-
current language (given as ISO code)
- path
-
array of sections in which this question is nested
- type
-
one of MultiAnswer, RangeAnswer or NumericAnswer
- questionnaire_date
-
date when questionnaire was created
- is_mandatory
-
boolean flag denoting whether this question is mandatory to fill in
- options
-
array of available options (applicable to MultiAnswer and RangeAnswer)
- answers
-
array of answer objects when question is not looping
- respondent
-
full name of respondent
- answer_text
-
answer provided
- looping_contexts
-
array of looping context objects when question is looping:
- looping_identifier
-
unique identifier of the looping context
- looping_path
-
array of loop item names that make up this looping context
- answers
-
array of answer objects (like for non-looping sections)
Supported Formats
JSON, XMLErrors
400 Bad Request401 Unauthorized
404 Not Found
422 Unprocessable Entity
500 Internal Server Error
Examples
{
"question":{
"id":384,
"section_id":244,
"looping_section_id":242,
"url":"/api/v1/questionnaires/16/questions/384",
"title":"Reasons for issuing of licences (art. 9, i. to v.)",
"language":"EN",
"path":["EXCEPTIONS CONCERNING PROTECTED FAUNA SPECIES (ART. 7
APPENDIX III)","Vertebrates","#[Class > Order]","#[Family]","#[Species]","Details"],
"type":"MultiAnswer",
"is_mandatory":true,
"options":[
"i.: protection of flora /fauna",
"ii.: prevention of serious damage to crops, livestock, forests, fisheries, water and other forms of property",
"iii.: in the interests of public health and safety, air safety or other overriding public interests (which?)",
"iv.: for research / education / repopulation / reintroduction / necessary breeding",
"v.: judicious exploitation of certain wild plants in small numbers and under certain conditions"
], "answers":[],
"looping_contexts":[
{
"looping_context":{
"looping_identifier":"6867S6868S6872",
"looping_path":[
"FISHES > CYPRINIFORMES",
"Cyprinidae",
"Alburnoides bipunctatus"
],
"answers":[
{
"answer":{
"respondent":"Kristina Klovaite",
"answer_text":"iv.: for research / education / repopulation / reintroduction / necessary breeding"
}
}
]
}
},
{
"looping_context":{
"looping_identifier":"7359S7360S7361",
"looping_path":[
"MAMMALS > LAGOMORPHA",
"Leporidae",
"Lepus timidus"
],
"answers":[
{
"answer":{
"respondent":"Tatsiana Trafimovich",
"answer_text":"v.: judicious exploitation of certain wild plants in small numbers and under certain conditions"
}
}
]
}
}
]
}
}
<question>
<id>384</id>
<section_id>244</section_id>
<looping_section_id>242</looping_section_id>
<url>/api/v1/questionnaires/16/questions/384</url>
<title>Reasons for issuing of licences (art. 9, i. to v.)</title>
<language>EN</language>
<path>["EXCEPTIONS CONCERNING PROTECTED FAUNA SPECIES (ART. 7&nbsp;&nbsp;
APPENDIX III)", "Vertebrates", "#[Class &gt; Order]", "#[Family]", "#[Species]", "Details"]</path>
<type>MultiAnswer</type>
<is_mandatory>true</is_mandatory>
<options>["i.: protection of flora /fauna", "ii.: prevention of serious damage to crops, livestock, forests, fisheries, water and other forms of property", "iii.: in the interests of public health and safety, air safety or other overriding public interests (which?)", "iv.: for research / education / repopulation / reintroduction / necessary breeding", "v.: judicious exploitation of certain wild plants in small numbers and under certain conditions"]</options>
<answers/>
<looping_answers>
<looping_context>
<looping_identifier>6867S6868S6872</looping_identifier>
<looping_path>["FISHES > CYPRINIFORMES", "Cyprinidae", "Alburnoides bipunctatus"]</looping_path>
<answer>
<respondent>A</respondent>
<answer_text>iv.: for research / education / repopulation / reintroduction / necessary breeding</answer_text>
</answer>
</looping_context>
<looping_context>
<looping_identifier>7359S7360S7361</looping_identifier>
<looping_path>["MAMMALS > LAGOMORPHA", "Leporidae", "Lepus timidus"]</looping_path>
<answer>
<respondent>B</respondent>
<answer_text>v.: judicious exploitation of certain wild plants in small numbers and under certain conditions</answer_text>
</answer>
</looping_context>
</looping_answers>
</question>
Params
| Param name | Description |
|---|---|
|
id required |
Id of the question Value: Must be String |
|
language optional |
Where available display data in language given by ISO code (e.g. “EN”). Defaults to questionnaire's default language. Value: Must be String |