Submit Survey

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search

Todd-chapman (Talk | contribs)
(New page: Submitting answers for an unknown question: $ curl -i -X POST -H "Accept: text/xml" -dprofile=1.LIUYRIUJLQNIOTA5 -dq9=a2 \ http://127.0.0.1:10001/v1/apps/survey/survey/s14 HTTP 4...)
Next diff →

Revision as of 18:04, 21 September 2010

Submitting answers for an unknown question:

 $ curl -i -X POST -H "Accept: text/xml" -dprofile=1.LIUYRIUJLQNIOTA5  -dq9=a2 \
   http://127.0.0.1:10001/v1/apps/survey/survey/s14
HTTP 400 (Bad Request)
Cache-Control: no-cache
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Pragma: no-cache
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 198
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 17:55:32 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <exception>
    <props></props>
  </exception>
  <input_error>
    <name>q9</name>
    <error>UNKNOWN_QUESTION</error>
  </input_error>
</result>

Submitting an invalid answer for a known question:

$ curl -i -X POST -H "Accept: text/xml" -dprofile=1.LIUYRIUJLQNIOTA5  -dq1=a9 \
  http://127.0.0.1:10001/v1/apps/survey/survey/s14

HTTP 400 (Bad Request)
Cache-Control: no-cache
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Pragma: no-cache
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 192
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 17:56:46 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <exception>
    <props></props>
  </exception>
  <input_error>
    <name>q1</name>
    <error>VALIDATION</error>
  </input_error>
</result>

Successfully submitting an answer:

$ curl -i -X POST -H "Accept: text/xml" -dprofile=1.LIUYRIUJLQNIOTA5  -dq1=a1 \
  http://127.0.0.1:10001/v1/apps/survey/survey/s14 

HTTP 200 (OK)
Cache-Control: no-cache
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Pragma: no-cache
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 81
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 17:57:48 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <status>1</status>
  <survey_complete>0</survey_complete>
</result>


Submitting an answer for a question that has already been recorded:

$ curl -i -X POST -H "Accept: text/xml" -dprofile=1.LIUYRIUJLQNIOTA5  -dq1=a1 \
 http://127.0.0.1:10001/v1/apps/survey/survey/s14
HTTP 400 (Bad Request)
Cache-Control: no-cache
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Pragma: no-cache
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 190
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 17:58:37 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <exception>
    <props></props>
  </exception>
  <input_error>
    <name>q1</name>
    <error>ANSWERED</error>
  </input_error>
</result>

Submitting a text answer and completing a survey:

$ curl -i -X POST -H "Accept: text/xml" -dprofile=1.LIUYRIUJLQNIOTA5 -dq3=a2 -dq4='this is my text answer' \ 
 http://127.0.0.1:10001/v1/apps/survey/survey/s14
HTTP 200 (OK)
Cache-Control: no-cache
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Pragma: no-cache
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 120
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 18:04:15 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <status>1</status>
  <survey_complete>1</survey_complete>
</result>
Personal tools