Incorrect data for multiple choice questions in the API

Hi there,

I have surveys where I use 'image' and 'multiple choice' questions. For some of these I allow multiple answers, for others I don't.
I tried to export the questions through the https://api.surveysparrow.com/v3/questions endpoint but encountered some unexpected values: the limit type is "UNLIMITED" for both types of questions. I would expect a different limit type for questions that don't allow multiple answers and the max_limit field to be 1. There's no way to discern between these two types right now as far as I can see.
Here's a snippet of the API response for two questions that hopefully illustrates the problem: https://jurriaan.be/api.json.

It would also be nice if there was a field to indicate if a question is required, but that's a feature request :slight_smile:

HI @uitrit4_comm.v ,

Welcome to the SurveySparrow Community :gem:

Many thanks for bringing this up. Indeed this is something ambiguous for the users and I will notify the concerned team.

{
"data":[
0:{
"id":5386041,
"rtxt": "Allow single choice",
"type":"MultiChoice",
"properties":{
"data":{
/* type: for the single choice  question shouldn't be UNLIMITED and the max value and min value should  be 1*/
"type":"UNLIMITED",
"min_limit":"",
"max_limit":"",
"exact_choices":""
}
}
/* Question Required or Not Required Option should be there */

Feel free to reach us for any queries. :wave:t4:

1 Like

Hello,

We made these changes in our API V3. Now whether the question is skippable or not can be identified via

"is_required":false 

And for a single answer to a Multiple choice question, we have added a parameter

 "multiple_answers": false
{
"data":[
0:{...}
1:{...}
2:{...}
3:{
"id":5497279
"rtxt":"Multiple choice - Allow 1 answer"
"type":"MultiChoice"
"multiple_answers":false /*This is by false for Single Answer*/
"is_required":false /*Informs whether the question is mandatory or not*/
"properties":{
........
}
}

Hope this helps :sunglasses:

1 Like