Skip to main content

Question

Add new question to template#

Add new question to template.

Request body:

AttributeTypeDescriptionNullable
nameStringQuestion namefalse
templateIdStringIdentifier of templatefalse
typeObjectQuestion type, see available types here false
calculatedBooleanAn indication that the question can be calculated false
requiredBooleanSign of the obligatory answer to the questionfalse
needCommentBooleanSign the user can leave a commentfalse
commentRequiredList of integersSign the user is obliged to leave a commenttrue
enableCustomAnswerBooleanSign the user can add his answer (text) false
conditionsList of objectsSetting the visibility of the question depending on the answer to another question true
hintObjectQuestion hinttrue

Response

Returns Question object

Examples

curl --request POST https://api.qvalon.com/v1/survey/questions \
--header 'Authorization: Bearer <your_token>' \
-d '{"name":"Test question","type":{"typeName":"NUMBER","multiple":false,"possibleAnswers":[],"minCountAnswer":null,"schemaId":null},"calculated":false,"required":false,"needComment":false,"commentRequired":false,"enableCustomAnswer":false,"conditions":[],"orderNum":11,"templateId":"608131be7eb7af765469e6a4"}'
200 OK
[
{
"id": "6082b4e67eb7af765469e732",
"templateId": "608131be7eb7af765469e6a4",
"deleted": false,
"tenant": "",
"name": "Test question",
"type": {
"typeName": "NUMBER",
"grades": [],
"multiple": false,
"possibleAnswers": []
},
"conditions": [],
"calculated": false,
"required": false,
"orderNum": 11,
"updateAt": "2021-04-23T11:52:06.053325",
"needComment": false,
"commentRequired": false,
"enableCustomAnswer": false
}
]

Update question#

Update question.

Request body:

AttributeTypeDescriptionNullable
nameStringQuestion namefalse
templateIdStringIdentifier of templatefalse
typeObjectQuestion type, see available types here false
calculatedBooleanAn indication that the question can be calculated false
requiredBooleanSign of the obligatory answer to the questionfalse
needCommentBooleanSign the user can leave a commentfalse
commentRequiredList of integersSign the user is obliged to leave a commenttrue
enableCustomAnswerBooleanSign the user can add his answer (text) false
conditionsList of objectsSetting the visibility of the question depending on the answer to another question true
hintObjectQuestion hinttrue

Response

Returns Question object

Examples

curl --request PUT https://api.qvalon.com/v1/survey/questions/606ac4f65b784e60cb88cb5b \
--header 'Authorization: Bearer <your_token>' \
-d '{"name":"Test question","type":{"typeName":"NUMBER","multiple":false,"possibleAnswers":[],"minCountAnswer":null,"schemaId":null},"calculated":false,"required":false,"needComment":false,"commentRequired":false,"enableCustomAnswer":false,"conditions":[],"orderNum":11,"templateId":"608131be7eb7af765469e6a4"}'
200 OK
[
{
"id": "6082b4e67eb7af765469e732",
"templateId": "608131be7eb7af765469e6a4",
"deleted": false,
"tenant": "",
"name": "Test question",
"type": {
"typeName": "NUMBER",
"grades": [],
"multiple": false,
"possibleAnswers": []
},
"conditions": [],
"calculated": false,
"required": false,
"orderNum": 11,
"updateAt": "2021-04-23T11:52:06.053325",
"needComment": false,
"commentRequired": false,
"enableCustomAnswer": false
}
]

Add hint to question#

Add text and(or) file hint to exist question

Request parameters:

Request ParameterTypeDescriptionRequired
hintStringText hintfalse

Request body:

AttributeTypeDescriptionNullable
fileMultipartFileFile hinttrue

Response

Returns Hint object

Examples

curl --request POST https://api.qvalon.com/v1/survey/questions/6082b4e67eb7af765469e732/hint?hint=simple text hint \
--header 'Authorization: Bearer <your_token>' \
--form 'file=@"/yourFileTest.png" '
200 OK
[
{
"textHint": "textHintExample",
"urlHint": [
{
"name": "samplescreenshot.png",
"uid": "a892f3e8-322d-4311-a31a-2bffa2295afe",
"url": "/files/s1/a/8/a892f3e8-322d-4311-a31a-2bffa2295afe.png",
"size": 94232,
"contentType": "image/png"
}
]
}
]

Update hint#

Update hint

Request parameters:

Request ParameterTypeDescriptionRequired
hintStringText hintfalse
uidsForDeleteList of stringsFile uids for deletefalse

Request body:

AttributeTypeDescriptionNullable
fileMultipartFileFile hinttrue

Response

Returns Hint object

Examples

curl --request PUT https://api.qvalon.com/v1/survey/questions/6082b4e67eb7af765469e732/hint?hint=simple text hint \
--header 'Authorization: Bearer <your_token>' \
--form 'file=@"/yourFileTest.png" '
200 OK
[
{
"textHint": "textHintExample",
"urlHint": [
{
"name": "samplescreenshot.png",
"uid": "a892f3e8-322d-4311-a31a-2bffa2295afe",
"url": "/files/s1/a/8/a892f3e8-322d-4311-a31a-2bffa2295afe.png",
"size": 94232,
"contentType": "image/png"
}
]
}
]

Get questions by instance#

Get questions by instance id

Request parameters:

Request ParameterTypeDescriptionRequired
withAnswersBooleanAdd answers object for each questiontrue

Response

Return list of Question objects

If param withAnswers is true, Answer object will be add to response objects

Examples

curl https://api.qvalon.com/v1/survey/questions/instance/6082b4e67eb7af765469e732 \
--header 'Authorization: Bearer <your_token>'
200 OK
[
{
"question": {
"id": "6080093d6ff4fb63493e3123",
"templateId": "606ac4f65b784e60cb88cb5b",
"originalId": "608008536ff4fb63493e3120",
"deleted": false,
"tenant": "",
"name": "Choose a number",
"type": {
"typeName": "NUMBER",
"grades": [],
"multiple": false,
"possibleAnswers": []
},
"conditions": [],
"calculated": false,
"required": true,
"orderNum": 0,
"updateAt": "2021-04-21T11:15:09.411",
"needComment": true,
"commentRequired": false,
"enableCustomAnswer": false
},
"lastModified": "2021-04-23T13:33:22.555",
"answers": {
"id": "6082cc8a7eb7af765469e737",
"tenant": "",
"answers": [
"1"
],
"fileAnswers": [],
"comment": "I chose the number",
"questionId": "6080093d6ff4fb63493e3123",
"instanceId": "6082cc827eb7af765469e736",
"dimension": {
"dimensionId": 0,
"dimensionName": ""
},
"updateAt": "2021-04-23T13:32:57.635"
}
}
]