Skip to content

Retrieving survey answers

pelleaardema edited this page May 15, 2014 · 4 revisions

GET: question_answers

Details

Retrieves a list of answers from a selected survey instance

Notes

Requires a survey instance Id

Endpoint

http://<>.appspot.com/rest/question_answers?surveyInstanceId=XYZ

Request data

parameter description
surveyInstanceId The Id of the survey instance for which you want to retrieve the answers

Response fields

field description type
question_answers.value The users answer Depends on type of answer
question_answers.type Answer type String
question_answers.oldValue The old value that was stored (if available) Depends on type of answer
question_answers.arbitratyNumber ?? Integer
question_answers.surveyId The Id of the survey the answer belongs to Integer
question_answers.questionId The Id of the question the answer belongs to String
question_answers.questionText The question text String
question_answers.collectionDate Date the answer was collected Unix 13-digit timestamp
question_answers.surveyInstanceId The Id of the survey instance the answer belongs to Integer
question_answers.keyId Unique key for this specific answer Integer

Example request

http://akvoflowsandbox.appspot.com/rest/question_answers?surveyInstanceId=8753058

{"question_answers":
    [{
    "value":"fgdhccfh",					
    "type":"VALUE",								
    "oldValue":null,							
    "arbitratyNumber":15,						
    "surveyId":4913002,							
    "questionID":"4893003",					
    "questionText":"free text question",
    "collectionDate":1398284542591,	
    "surveyInstanceId":8753058,	
    "keyId":8763061			
},
    {
    "value":"69.696313|82.498708|65|2gxsyu63f",	
    "type":"GEO",
    "oldValue":null,
    "arbitratyNumber":15,
    "surveyId":4913002,
    "questionID":"5003002",
    "questionText":"geolocation ",
    "collectionDate":1398284542591,
    "surveyInstanceId":8753058,
    "keyId":8763064
    }]
}
Clone this wiki locally