getSurveyFrequencies

getSurveyFrequencies – returns answer frequencies for survey
request_method: GET
 
GET parameters:

  • action=getSurveyFrequencies
  • ank_id=123        (survey id)

Response example:

[
{"question_text":"Multiple answers with other", //question type multiple answers
"question_id":"803405_0",
"question_type":"0",
"answers":{
"invalid":{"-1":{"text":"No reply","cnt":0},"-2/*… all non-responses*/},
"validCnt":3, //valid responses
"allCnt":3, //all answers
"valid":[
{"text":"First","text_graf":"First","cnt":0,"value":1},
{"text":"Second","text_graph":"Second","cnt":"1","value":2},
{"text":"Third","text_graph":"Third","cnt":0,"value":3},
{"text":"Other:","text_graf":"Other:","cnt":"2","value":4}, //other
{"text":"something else","cnt":1,"text_graph":null,"value":"something else","other":1}, 
{"text":"something","cnt":1,"text_graph":null,"value":"something","other":1}
]
}
},
{"text_question":"One answer with other", //question type one answer
"question_id":"803406_0",
"Question_type":"1",
"answers":[
{"invalid":{"-1":{"text":"No reply","cnt":0},"-2/*… all non valid answers*/},
"valid":[
{"text":"0","text_graph":null,"cnt":"1"},//cnt showa how many times this radio has been chosen
{"text":"1","text_graph":null,"cnt":"2"}
],
"validCnt":3,
"allCnt":3,
"tittle":"First"},//answer text
{"invalid":{/*… here are all invalid answers for this button },
"valid":[
{"text":"0","text_graph":null,"cnt":"2"},
{"text":"1","text_graph":null,"cnt":"1"}
],
"validCnt":3,
"allCnt":3,
"tittle":"Second"},
{"invalid":{"/*… all non valid answers*/},
"valid":[
{"text":"0","text_graph":null,"cnt":"1"},
{"text":"1","text_graph":null,"cnt":"2"}
],
"validCnt":3,
"allCnt":3,
"tittle":"Third"},
{"invalid/*… all non valid answers },
"valid":[
{"text":"0","text_graph":null,"cnt":"1"},
{"text":"1","text_graph":null,"cnt":"2"}
],
"validCnt":3,
"allCnt":3,
"tittle":"Second:"},
{"invalid/*… },
"invalidCnt":1,
"allCnt":3,
"validCnt":2,
"average":null,
"valid":[ //answers for 'other'
{"text":"something something else","cnt":1,"text_graph":null},
{"text":"something something","cnt":1,"text_graph":null}
],
"other":1,
"tittle":"Other:"}
]
},
{"Question_text":"Text", //text type question
"question_id":"803407_0",
"question_type":"2",
"answers":[
{"invalid/*… all non valid answers*/},
"invalidCnt":1,
"allCnt":3,
"validCnt":2,
"average":null,
"valid":[
{"text":"random text","cnt":1,"text_graph":null},
{"text":"Hello, world!","cnt":1,"text_graph":null}
]}]}]

 

1KA is free to use for basic users