Rate a Contest Entry
From ePrize Developers Wiki
Rate a Contest Entry
Rate a contest entry with an invalid rating:
$ curl -i -X POST -H "Accept: text/xml" \ -dprofile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \ -drating=h \ http://test.url.eprize.com/v1/solution/contestv2/contest/entry/1/rate HTTP 400 (Bad Request) Cache-Control: no-cache Connection: close Date: Thu, 01 Apr 2010 04:00:00 GMT Pragma: no-cache Server: POE HTTPD Component/0.09 (5.008008) Content-Length: 147 Content-Type: text/xml; charset=utf-8 Expires: Mon, 26 Jul 2010 16:56:20 GMT <?xml version="1.0" encoding="UTF-8" ?> <result> <input_error> <name>rating</name> <error>VALIDATION</error> </input_error> </result>
Rate an entry successfully:
$ curl -i -X POST -H "Accept: text/xml" \ -dprofile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \ -drating=1 \ http://test.url.eprize.com/v1/solution/contestv2/contest/entry/1/rate HTTP 200 (OK) Cache-Control: no-cache Connection: close Date: Thu, 01 Apr 2010 04:00:00 GMT Pragma: no-cache Server: POE HTTPD Component/0.09 (5.008008) Content-Length: 502 Content-Type: text/xml; charset=utf-8 Expires: Mon, 26 Jul 2010 16:56:54 GMT <?xml version="1.0" encoding="UTF-8" ?> <result> <entry> <body>this is the body of my essay</body> <category></category> <city></city> <description></description> <entry_id></entry_id> <entry_state>approved</entry_state> <first_name></first_name> <last_name></last_name> <rating_ave>0.667</rating_ave> <rating_count>3</rating_count> <state></state> <title>this is the title of my essay</title> <views>0</views> <votes>0</votes> </entry> </result>
Already reached rating limit:
$ curl -i -X POST -H "Accept: text/xml" \ -dprofile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \ -drating=1 \ http://test.url.eprize.com/v1/solution/contestv2/contest/entry/1/rate HTTP 400 (Bad Request) Cache-Control: no-cache Connection: close Date: Thu, 01 Apr 2010 04:00:00 GMT Pragma: no-cache Server: POE HTTPD Component/0.09 (5.008008) Content-Length: 144 Content-Type: text/xml; charset=utf-8 Expires: Mon, 26 Jul 2010 16:57:31 GMT <?xml version="1.0" encoding="UTF-8" ?> <result> <input_error> <name>rating</name> <error>LIMITED</error> </input_error> </result>
Rating timeout:
$ curl -i -X POST -H "Accept: text/xml" \ -dprofile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \ -drating=1 \ http://test.url.eprize.com/v1/solution/contestv2/contest/entry/1/rate HTTP 400 (Bad Request) Cache-Control: no-cache Connection: close Date: Wed, 07 Apr 2010 08:48:00 GMT Pragma: no-cache Server: POE HTTPD Component/0.09 (5.008008) Content-Length: 155 Content-Type: text/xml; charset=utf-8 Expires: Mon, 26 Jul 2010 17:32:09 GMT <?xml version="1.0" encoding="UTF-8" ?> <result> <input_error> <name>profile_id</name> <error>RATING_TIMEOUT</error> </input_error> </result>
Rating in wrong phase:
$ curl -i -X POST -H "Accept: text/xml" \ -dprofile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \ -drating=1 \ http://test.url.eprize.com/v1/solution/contestv2/contest/entry/1/rate HTTP 400 (Bad Request) Cache-Control: no-cache Connection: close Date: Thu, 25 Mar 2010 04:00:00 GMT Pragma: no-cache Server: POE HTTPD Component/0.09 (5.008008) Content-Length: 108 Content-Type: text/xml; charset=utf-8 Expires: Mon, 26 Jul 2010 17:47:23 GMT <?xml version="1.0" encoding="UTF-8" ?> <result> <terminal_error>OUT_OF_PHASE</terminal_error> </result>
Rating non-existent entry:
$ curl -i -X POST -H "Accept: text/xml" \ -dprofile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \ -drating=1 \ http://test.url.eprize.com/v1/solution/contestv2/contest/entry/5/rate HTTP 404 (Not Found) Cache-Control: no-cache Connection: close Date: Thu, 01 Apr 2010 04:00:00 GMT Pragma: no-cache Server: POE HTTPD Component/0.09 (5.008008) Content-Length: 81 Content-Type: text/xml; charset=utf-8 Expires: Mon, 26 Jul 2010 17:48:16 GMT <?xml version="1.0" encoding="UTF-8" ?> <result> <status>0</status> </result>