Response_Create(string key, int surveyId)

Description

Create a survey response. Returns the new response ID. 

Parameter Type Required Description
key string Yes Your API key – used to authenticate your account
surveyId int Yes The ID of the survey you want to modify
optionalParameters[isComplete] bool No Set a response as completed
optionalParameters[personCode] string No A unique respondent identifier
optionalParameters[urlVariables] struct No A struct of URL Variables: {name=>value}
updateParameters struct Yes The structure changes depending on the question type see below for details
Question Type Structure Example
singleText updateParameters[{QuestionID}]=string updateParameters[13]=steve
multiText updateParameters[{QuestionID}]=string updateParameters[13]=steve
singleChoice updateParameters[{QuestionID}][{ChoiceID}]=bool updateParameters[16][44]=1
multiChoice updateParameters[{QuestionID}][{ChoiceID}]=bool updateParameters[16][44]=1
addSum updateParameters[{QuestionID}][{ChoiceID}]=int updateParameters[18][59]=20
ranker updateParameters[{QuestionID}][{ChoiceID}]=int updateParameters[18][59]=2
matrix updateParameters[{QuestionID}][{RowID}][{ChoiceID}]=bool updateParameters[17][5][54]=1
Call (GET)
http://api.surveytown.com/2/REST/?method=Response_Create&key=YOUR_API_KEY&surveyId=SURVEY_ID
Response
 1