Tattle on a Contest Entry

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(New page: ==== Tattle on a Contest Entry ==== Tattle on an entry: $ curl -i -X POST -H "Accept: text/xml" \ -dprofile=http://127.0.0.1:10001/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV ...)
Current revision (18:22, 27 December 2011) (edit) (undo)
 
(5 intermediate revisions not shown.)
Line 1: Line 1:
-
==== Tattle on a Contest Entry ====
+
{{RESTfulAPI
 +
|crumbs=[[API Home Page]] :: [[Contest API|Contest]]
 +
|summary=Send a notification about a specific entry to an administrator. The result will be an email to a predefined tattle recipient configured in the [[API Key]]
 +
|resource=/v1/{apikey}/contest/entry/{entryid}/tattle
 +
|methods=POST
 +
|resourceargs='''apikey''': Your [[API Key]].
-
Tattle on an entry:
+
'''entryid''': ID of the entry retrieved from [[Enter Contest|entry creation]] or by viewing the [[Browse_Contest_Gallery|gallery]].
 +
|paramsrequired='''reason''': reason for flagging this entry.
-
$ curl -i -X POST -H "Accept: text/xml" \
+
'''profile''': Canonical Location of a user profile. See: [[Fetch_profile_by_key|Fetch Profile by Key]]
-
-dprofile=http://127.0.0.1:10001/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV \
+
}}
-
-dreason='not work safe' \
+
{{RESTfulExample
-
http://127.0.0.1:10001/v1/solution/contestv2/contest/entry/1/tattle
+
|title=Successful tattle
-
+
|summary=Demonstrates successful response
-
HTTP 200 (OK)
+
|request=profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
-
Cache-Control: no-cache
+
reason: 'not work safe'
-
Connection: close
+
|responsecode=200 OK
-
Date: Thu, 01 Apr 2010 04:00:00 GMT
+
|response=<?xml version="1.0" encoding="UTF-8" ?>
-
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 18:18:57 GMT
+
-
+
-
<?xml version="1.0" encoding="UTF-8" ?>
+
<result>
<result>
-
<entry>
+
<status>1</status>
-
<body>this is the body of my essay</body>
+
-
<category></category>
+
-
<city></city>
+
-
<description></description>
+
-
<entry_id></entry_id>
+
-
<entry_state>MI</entry_state>
+
-
<first_name></first_name>
+
-
<last_name></last_name>
+
-
<rating_ave>0.857</rating_ave>
+
-
<rating_count>7</rating_count>
+
-
<state></state>
+
-
<title>this is the title of my essay</title>
+
-
<views>0</views>
+
-
<votes>0</votes>
+
-
</entry>
+
</result>
</result>
 +
}}
 +
{{RESTfulExample
 +
|title=Tattle on an entry ID that does not exist
 +
|request=profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
 +
reason: 'not work safe'
 +
|responsecode=404 Not Found
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result>
 +
<status>0</status>
 +
</result>
 +
}}
 +
{{RESTfulExample
 +
|title=Missing reason
 +
|request=profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
 +
|responsecode=404 Not Found
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result>
 +
<status>0</status>
 +
</result>
 +
}}

Current revision

API Home Page :: Contest

Summary

Send a notification about a specific entry to an administrator. The result will be an email to a predefined tattle recipient configured in the API Key

Resource

/v1/{apikey}/contest/entry/{entryid}/tattle

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

reason: reason for flagging this entry.

profile: Canonical Location of a user profile. See: Fetch Profile by Key



Example: Successful tattle

Summary

Demonstrates successful response

Request

profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
reason: 'not work safe'

Response

HTTP Status Code: 200 OK


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


Example: Tattle on an entry ID that does not exist

Request

profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV
reason: 'not work safe'

Response

HTTP Status Code: 404 Not Found


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


Example: Missing reason

Request

profile: http://test.url.eprize.com/v1/solution/contestv2v2/profile/1.5J4L55FNLN2CZZDV

Response

HTTP Status Code: 404 Not Found


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


Personal tools