getsurveys
Fetch all surveys available.
Parameters
api_key — Required. API key.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=getsurveys&api_key=XXXX
Sample JSON Response
[{
"sid":"08F54B",
"title":"Weight Management Survey",
"template":"GrassRoots.php"
},
{
"sid":"596A45",
"title":"Music Stuff",
"template":"CorporateBoxes.php"
}]
gettemplates
Fetch all survey templates available.
Parameters
api_key — Required. API key.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=gettemplates&api_key=XXXX
Sample JSON Response
[{
"AskPeopleDefault.php",
"CorporateBoxes.php",
"GreenGiant.php",
"NewTemplate.php",
"SimpleBlue.php",
}]
getquestions
Fetch all questionnaires available
Parameters
api_key — Required. API key.
sid — Required. Survey ID.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=getquestions&api_key=XXXX&sid=XXXX
Sample JSON Response
[{
"questionid":"1",
"type":"multi",
"validation":"optional",
"questiontext":"Which TV station do you often tune in?",
"options":{
"CW":"CW",
"CBS":"CBS",
"Fox":"Fox",
"NBC":"NBC",
"CNN":"CNN"
},
"scale":null
},
{
"questionid":"4",
"type":"single",
"validation":"required",
"questiontext":"What timeslot do you usually tune in?",
"options":{
"before10am":"before 10 am",
"10am3pm":"10am - 3pm",
"3pm7pm":"3pm - 7pm",
"6pmto12mn":"6pm to 12mn"
},
"scale":null
}]
Possible Errors
— invalid sid
createsurvey
Creates a new survey
Parameters
api_key — Required. API key.
title — Required. Main title of the survey.
template — Required. Selected template for the survey.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=createsurvey&api_key=XXXX&title=XXXX&template=XXXX
Sample JSON Response
[{
"success":true,
"sid":"D54AC1"
}]
Possible Errors
— title parameter required
— template parameter required
addquestion
Adds a question under a specific survey
Parameters
api_key — Required. API key.
sid — Required. Survey ID.
qtype — Required. Question field type.
qvalid — Required. If question is optional or required.
question — Required. Question title.
options — Optional. Optional answers for the question.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=addquestion&api_key=XXXX&sid=XXXX&qtype=XXXX&qvalid=XXXX
&question=XXXX&options=XXXX
Sample JSON Response
[{
"success":true
}]
Possible Errors
— invalid sid
— sid parameter required
— qtype parameter required
— qvalid parameter required
— question parameter required
editsurvey
Updates modified survey
Parameters
api_key — Required. API key.
sid — Required. Survey ID.
title — Required. Main title of the survey.
template — Required. Selected template for the survey.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=editsurvey&api_key=XXXX&sid=XXXX&title=XXXX&template=XXXX
Sample JSON Response
[{
"success":true
}]
Possible Errors
— invalid sid
— sid parameter required
— title parameter required
editquestion
Updates questionnaire details
Parameters
api_key — Required. API key.
sid — Required. Survey ID.
qid — Required. Questionnaire ID.
qtype — Required. Question field type.
qvalid — Required. If question is optional or required.
question — Required. Question title.
options — Optional. Optional answers for the question.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=editquestion&api_key=XXXX&sid=XXXX&qid=XXXX&qtype=XXXX
&qvalid=XXXX&question=XXXX&options=XXXX
Sample JSON Response
[{
"success":true
}]
Possible Errors
— invalid sid
— invalid qid
— sid parameter required
— title parameter required
deletesurvey
Deletes selected survey
Parameters
api_key — Required. API key.
sid — Required. Survey ID.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=deletesurvey&api_key=XXXX&sid=XXXX
Sample JSON Response
[{
"success":true
}]
Possible Errors
— invalid sid
— sid parameter required
deletequestion
Deletes selected questionnaire from survey
Parameters
api_key — Required. API key.
sid — Required. Survey ID.
qid — Required. Questionnaire ID.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=deletequestion&api_key=XXXX&sid=XXXX&qid=XXXX
Sample JSON Response
[{
"success":true
}]
Possible Errors
— invalid sid
— invalid qid
— sid parameter required
— qid parameter required
getreport
Fetches statistical results of a survey
Parameters
api_key — Required. API key.
sid — Required. Survey ID.
qid — Optional. Questionnaire IDs, default is 'all'.
Making a Request
When creating a request, use this URL to submit your query:
http://www.surveycontrib.applications.net/survey/api.php/?request=getreport&api_key=XXXX&sid=XXXX&qid=all
Sample JSON Response
[{
"questionid":"1",
"questiontext":"Which TV station do you often tune in?",
"answered":5,
"total":5,
"stats":
[{
"option":"CW",
"total":1,
"percent":"20%"
},
{
"option":"CBS",
"total":2,
"percent":"40%"
},
{
"option":"Fox",
"total":2,
"percent":"40%"
},
{
"option":"NBC",
"total":null,
"percent":null
},
{
"option":"CNN",
"total":1,
"percent":"20%"
}]
}]
Possible Errors
— invalid sid