Rate a Contest Entry
From ePrize Developers Wiki
Line 8: | Line 8: | ||
'''entryid''': ID of the entry retrieved from [[Enter Contest|entry creation]] or by viewing the [[Browse_Contest_Gallery|gallery]]. | '''entryid''': ID of the entry retrieved from [[Enter Contest|entry creation]] or by viewing the [[Browse_Contest_Gallery|gallery]]. | ||
- | |paramsrequired='''profile''': Canonical Location of a user profile. See: [[Fetch | + | |paramsrequired='''profile''': Canonical Location of a user profile. See: [[Fetch profile by key]] |
+ | |||
+ | '''rating''': numeric rating 1 - 5 | ||
}} | }} | ||
Line 41: | Line 43: | ||
|title=Rate a contest entry with an invalid rating | |title=Rate a contest entry with an invalid rating | ||
|summary=Demonstrates error response | |summary=Demonstrates error response | ||
- | |request= | + | |request=profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV |
- | + | rating=h | |
- | + | ||
|responsecode=400 Bad Request | |responsecode=400 Bad Request | ||
|response=<?xml version="1.0" encoding="UTF-8" ?> | |response=<?xml version="1.0" encoding="UTF-8" ?> | ||
Line 57: | Line 58: | ||
|title=Already reached rating limit | |title=Already reached rating limit | ||
|summary=Demonstrates unsuccessful response | |summary=Demonstrates unsuccessful response | ||
- | |request= | + | |request=profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV |
- | + | rating=1 | |
- | + | ||
|responsecode=400 Bad Request | |responsecode=400 Bad Request | ||
|response=<?xml version="1.0" encoding="UTF-8" ?> | |response=<?xml version="1.0" encoding="UTF-8" ?> | ||
Line 74: | Line 74: | ||
|summary=Demonstrates unsuccessful response | |summary=Demonstrates unsuccessful response | ||
|responsecode=400 Bad Request | |responsecode=400 Bad Request | ||
- | |request= | + | |request=profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV |
- | + | rating=1 | |
- | + | ||
|response=<?xml version="1.0" encoding="UTF-8" ?> | |response=<?xml version="1.0" encoding="UTF-8" ?> | ||
<result> | <result> | ||
Line 89: | Line 88: | ||
|title=Rating in wrong phase: | |title=Rating in wrong phase: | ||
|summary=Demonstrates unsuccessful response | |summary=Demonstrates unsuccessful response | ||
- | |request= | + | |request=profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV |
- | + | rating=1 | |
- | + | ||
|responsecode=400 Bad Request | |responsecode=400 Bad Request | ||
|response=<?xml version="1.0" encoding="UTF-8" ?> | |response=<?xml version="1.0" encoding="UTF-8" ?> | ||
Line 102: | Line 100: | ||
|title=Rating non-existent entry | |title=Rating non-existent entry | ||
|summary=Demonstrates unsuccessful response | |summary=Demonstrates unsuccessful response | ||
- | |request= | + | |request=profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV |
- | + | rating=1 | |
- | + | ||
|responsecode=404 Not Found | |responsecode=404 Not Found | ||
|response=<?xml version="1.0" encoding="UTF-8" ?> | |response=<?xml version="1.0" encoding="UTF-8" ?> |
Revision as of 19:16, 19 April 2011
Summary
Rate a contest entry. A rating is provided by a user and must be associated with a profile. The average rating is recomputed with each rate action.
Resource
/v1/{apikey}/contest/entry/{entryId}/rate
Valid Methods
POST
Resource Arguments
Note: resource arguments are always required.
apikey: Your API Key.
entryid: ID of the entry retrieved from entry creation or by viewing the gallery.
Parameters Required
profile: Canonical Location of a user profile. See: Fetch profile by key
rating: numeric rating 1 - 5
Example: Rate an entry successfully:
Summary
Demonstrates successful response
Request
profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV rating: 1
Response
HTTP Status Code: 200 OK
<?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>
Example: Rate a contest entry with an invalid rating
Summary
Demonstrates error response
Request
profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV rating=h
Response
HTTP Status Code: 400 Bad Request
<?xml version="1.0" encoding="UTF-8" ?> <result> <input_error> <name>rating</name> <error>VALIDATION</error> </input_error> </result>
Example: Already reached rating limit
Summary
Demonstrates unsuccessful response
Request
profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV rating=1
Response
HTTP Status Code: 400 Bad Request
<?xml version="1.0" encoding="UTF-8" ?> <result> <input_error> <name>rating</name> <error>LIMITED</error> </input_error> </result>
Example: Rating timeout
Summary
Demonstrates unsuccessful response
Request
profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV rating=1
Response
HTTP Status Code: 400 Bad Request
<?xml version="1.0" encoding="UTF-8" ?> <result> <input_error> <name>profile_id</name> <error>RATING_TIMEOUT</error> </input_error> </result>
Example: Rating in wrong phase:
Summary
Demonstrates unsuccessful response
Request
profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV rating=1
Response
HTTP Status Code: 400 Bad Request
<?xml version="1.0" encoding="UTF-8" ?> <result> <terminal_error>OUT_OF_PHASE</terminal_error> </result>
Example: Rating non-existent entry
Summary
Demonstrates unsuccessful response
Request
profile=http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV rating=1
Response
HTTP Status Code: 404 Not Found
<?xml version="1.0" encoding="UTF-8" ?> <result> <status>0</status> </result>