Skip to content

Retrieving survey instances

pelleaardema edited this page May 15, 2014 · 13 revisions

GET: survey_instances

Details

Retrieves a list of answered surveys (survey instances) for the selected survey

Notes

Requires a survey Id

Endpoint

http://<>.appspot.com/rest/survey_instances?surveyId=XYZ

Request data

parameter description
surveyId (required) The Id of the survey of which you want to retrieve the question groups
deviceId (optional) The Id of the device
since (optional) Retrieve all survey instances since a specified date
beginDate (optional) Retrieve all survey instances for a specific date range - begin date
endDate (optional) Retrieve all survey instances for a specific date range - end date
submitterName (optional) Retrieve survey instances for a specific submitter
countryCode (optional) Retrieve survey instances for a specific country
level1 (optional) ??
level2 (optional) ??

Response fields

field description type
survey_instances.surveyCode The name of the survey String
survey_instances.surveyId survey Id String
survey_instances.submitterName Name of the person who submitted the answers String
survey_instances.deviceIdentifier Id of the device through which the survey was submitted String
survey_instances.approximateLocationFlag ??
survey_instances.approvedFlag ??
survey_instances.userID User ID of the person who submitted the answers Integer
survey_instances.collectionDate Date the answers are collected Unix timestamp
survey_instances.questionAnswersStore ??
survey_instances.surveyalTime time (in seconds) it took to collect the answers Integer
survey_instances.keyId Unique key for this instance Integer

Example request

http://akvoflowsandbox.appspot.com/rest/survey_instances?surveyId=4913002&deviceId=&since=&beginDate=&endDate=&submitterName=&countryCode=&level1=&level2=

{"survey_instances":
    [{"surveyCode":"1.6.8 Ruarcc Test Group/1.6.8 All Questions",
    "surveyId":4913002,
    "submitterName":"hotfixer",
    "deviceIdentifier":"hotfixers",
    "approximateLocationFlag":null,
    "approvedFlag":null,
    "userID":1,
    "collectionDate":1398284542591,
    "questionAnswersStore":null,
    "surveyalTime":27,
    "keyId":8753058
    }, 
Clone this wiki locally