Variable

Should you want to pass a variable to a Socrates survey you can do so with this API call.

URL https://www.socratesinsights.com/api/conversation/variable
HTTP Method(s) POST

Example Request

<?xml version="1.0" encoding="UTF-8"?>
<conversation>
    <token>XYZ123456</token>
    <variable>
        <name>animal</name>
        <value>fish</value>
    </variable>
</conversation>
Parameters
token required. Supplied during conversation/start and relevant to the survey you are about to take.
variable > name required. Variable name passed to survey.
variable > value required. Variable value passed to survey.

Example Response (valid request)

<?xml version="1.0" encoding="UTF-8"?>
<conversation>
    <token>XYZ123456</token>
    <message>Variable passed successfully</message>
</conversation>

Example Response (invalid request)

<?xml version="1.0" encoding="UTF-8"?>
<conversation>
    <error>
        <message>Invalid token.</message>
    </error>
</conversation>
Parameters
token Supplied during conversation/start and relevant to the survey you are about to take.
message Message displayed when variable passed successfully.
error > message This appears should you supply an invalid token or invalid variable name and/or variable value.