Web Service - Methods - GetSurveyResponsesAsXML
GetSurveyResponsesAsXML
This method is used to retrieve the responses to the questions on your TextSurvey.
You must supply a Start Date/Time and an End Date/Time - this will filter the report so that it contains the responses received for numbers that were enrolled between those dates and times.
You can optionally supply an Enrolment Reference. This will filter the report so that contains only responses from numbers that were enrolled using the same reference. This reference can be supplied when enrolling numbers through the TextSurvey section of our site, or through the EnrolIntoSurveyWithReference method.
On successful completion, this method will return transaction code 1.
If the survey cannot be found, this method will return transaction code 386 (Survey not found).
If the period between the startDate and endDate parameters is more than a year, this method will return transaction code 404 (Period too long).
Return Data
XML:
When XML is requested, each response element will contain a ResponseType element. Possible ResponseTypes are:
ResponseType
|
Description
|
Valid
|
A normal response.
|
No Matching Category
|
The response didn’t match any of the categories for the question asked. Depending on how the TextSurvey is configured, we will have either resent the question, or sent a prompting text.
|
No Matching Category (Proceeding To Next Question)
|
The response didn’t match any of the categories for the question asked, and the question was set up to send the next question in this scenario.
|
Survey Has Finished
|
The response was received when the survey was no longer running. This happens when the ‘Stop’ button is clicked on the Manage Surveys page.
|
Enrolment Has Completed Survey
|
The response was received after the user had already completed the survey.
|
Survey Not Started
|
The response was received after the survey’s introductory message was sent, but before the survey’s first question was sent. This can happen if the introductory question is set up with a long wait time.
|
Received When Question Not Sent
|
The response was received after the survey had previously failed to send a question. This can happen if the survey is paused, or if your account doesn’t have enough credit to send questions. Pending questions can be resent through the Manage Surveys page.
|
Enrolment
|
The message received caused the user to be enrolled into the survey.
|
Enrolment Not Allowed
|
The message was received from a user that had previously completed the survey, and the survey had its ‘Allow duplicate enrolments’ setting switched off.
|
Duplicate Answer
|
The message was received multiple times. This will result in one Valid response, as well as several Duplicate Answers.
|
<GetSurveyResponsesAsXMLResponse>
<Transaction>
<IP>123.123.123.123</IP>
<Code>1</Code>
<Description>Transaction OK</Description>
</Transaction>
<ResponseReport>
<Survey>
<SurveyName />
<SurveyID />
<Questions>
<Question>
<QuestionID / >
<Body />
<IsFinalQuestion />
<IsIntroductoryQuestion />
<ResponseCategories>
<Category>
<MatchType />
<ResponseBody />
<NextQuestionID />
<IsDefaultCategory />
</Category>
</ResponseCategories>
</Question>
</Questions>
</Survey>
<Enrolments>
<Enrolment>
<Destination />
<EnrolmentDate />
<EnrolmentID />
<ClientReference />
</Enrolment>
</Enrolments>
<Responses>
<Response>
<EnrolmentID />
<Body />
<ResponseDate />
<QuestionID />
<ResponseType />
</Response>
</Responses>
</ResponseReport>
</GetResponsesResponse>
The schema for this XML is available
here.