HTTPS Service - Methods - EnrolIntoSurvey
EnrolIntoSurvey
This method is used to enrol one or more numbers into an existing TextSurvey
When one or more numbers are passed to this method, the first text message in your survey is sent to the recipient(s).
The first text is either the introductory text, if you have one set up, or the first question of the survey.
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.
However please note that if a 389 code is returned none of the numbers supplied in the original request will have been enrolled in the survey. You will need to resubmit these in a subsequent request.
Return Data
XML:
<EnrolIntoSurveyResponse>
<Transaction>
<IP>123.123.123.123</IP>
<Code>1</Code>
<Description>Transaction OK</Description>
</Transaction>
<NumbersAlreadyEnrolledAndActive>
</NumbersAlreadyEnrolledAndActive>
</EnrolIntoSurveyResponse>
XML for transaction code 389:
<EnrolIntoSurveyResponse>
<Transaction>
<IP>123.123.123.123</IP>
<Code>389</Code>
<Description>The destinations parameter contained numbers that are already enrolled and active on the specified Survey.</Description>
</Transaction>
<NumbersAlreadyEnrolledAndActive>
<string>+447980123456</string>
</NumbersAlreadyEnrolledAndActive>
</EnrolIntoSurveyResponse>
CSV:
#1# "1","+447980123456"