Web Service - Methods - GetAllSurveyResponsesAsXML

GetAllSurveyResponsesAsXML

This method is used to retrieve the response to the questions on your TextSurvey, including any invalid responses.

You must supply a Start Date/Time and an End Date/Time - this will filter the report so that it contains only responses received 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.

» externalLogin» String
» password» String
» surveyID » Integer
» ClientEnrolmentReference » String
» startDate » DateTime
» endDate » DateTime

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).

For pre-pay accounts, if the account does not have enough credit to send the survey’s first questions, this method will return transaction code 387 Questions could not be sent – not enough credit.

If the destinations parameter contains no valid numbers (this includes numbers that cannot be parsed or, for Surveys that do not allow duplicate enrolments, numbers that are already enrolled), this method will return transaction code 388 The destinations parameter contained no valid numbers.

For Surveys that allow duplicate enrolments, if the destinations parameter contains the number of a user that is already enrolled and is currently participating in your Survey, this method will return transaction code 389 The destinations parameter contained numbers that are already enrolled and active on the specified Survey.

The XML response will list the numbers affected. You can either wait for the Participant to finish their Survey, or you use the CancelParticipant method to cancel their session. You will then be able to re-enrol them.

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.


    <GetAllSurveyResponsesAsXMLResponse>
        <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.