Fetch a Contest Entry

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(New page: ==== Fetch a Contest Entry ==== Fetch entry: $ curl -i -X GET -H "Accept: text/xml" \ http://test.url.eprize.com/v1/eprize/ews12/contestv2/contest/entry/1 HTTP 200 (OK) Cache-Con...)
Line 1: Line 1:
-
==== Fetch a Contest Entry ====
+
{{RESTfulAPI
 +
|crumbs=[[API Home Page]] :: [[Contest API|Contest]]
 +
|summary=Fetch a [[Enter Contest|contest entry]] by ID. This will return information about the contest entry.
 +
|resource=/v1/{apikey}/contest/entry/{entryid}
 +
|methods=GET
 +
|resourceargs='''apikey''': Your [[API Key]].
-
Fetch entry:
+
''entryid''': ID of the entry retrieved from [[Enter contest|entry creation]] or by viewing the [[Browse_Contest_Gallery|gallery]].
-
 
+
|paramsrequired=None.
-
$ curl -i -X GET -H "Accept: text/xml" \
+
}}
-
http://test.url.eprize.com/v1/eprize/ews12/contestv2/contest/entry/1
+
{{RESTfulExample
-
+
|title=Successfully fetch an entry
-
HTTP 200 (OK)
+
|summary=Demonstrates successful response
-
Cache-Control: public
+
|responsecode=200 OK
-
Connection: close
+
|response=<?xml version="1.0" encoding="UTF-8" ?>
-
Date: Fri, 23 Jul 2010 21:43:40 GMT
+
-
Server: POE HTTPD Component/0.09 (5.008008)
+
-
Content-Length: 533
+
-
Content-Type: text/xml; charset=utf-8
+
-
Expires: Fri, 23 Jul 2010 21:53:40 GMT
+
-
+
-
<?xml version="1.0" encoding="UTF-8" ?>
+
<result>
<result>
<entry>
<entry>
Line 34: Line 32:
</entry>
</entry>
</result>
</result>
 +
}}
 +
{{RESTfulExample
 +
|title=Request an entry ID that does not exist
 +
|responsecode=404 Not Found
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result>
 +
<status>0</status>
 +
</result>
 +
}}

Revision as of 18:28, 19 April 2011

API Home Page :: Contest

Summary

Fetch a contest entry by ID. This will return information about the contest entry.

Resource

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

Valid Methods

GET

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

None.



Example: Successfully fetch an entry

Summary

Demonstrates successful response


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>1</category>
     <city>PLEASANT RIDGE</city>
     <description></description>
     <entry_id>1</entry_id>
     <entry_state>approved</entry_state>
     <first_name>Todd</first_name>
     <last_name>C</last_name>
     <rating_ave>0.000</rating_ave>
     <rating_count>0</rating_count>
     <state>MI</state>
     <title>this is the title of my essay</title>
     <views>0</views>
     <votes>0</votes>
   </entry>
 </result>


Example: Request an entry ID that does not exist

Response

HTTP Status Code: 404 Not Found


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


Personal tools