Get All Contest Entries for a Profile

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(New page: $ curl -i -X GET -H "Accept: text/xml" \ http://127.0.0.1:10001/v1/solution/contestv2/profile/1.5J4L55FNLN2CZZDV/contest/entry HTTP 200 (OK) Cache-Control: public Connection: clos...)
Current revision (18:49, 19 April 2011) (edit) (undo)
 
(One intermediate revision not shown.)
Line 1: Line 1:
-
$ curl -i -X GET -H "Accept: text/xml" \
+
{{RESTfulAPI
-
http://127.0.0.1:10001/v1/solution/contestv2/profile/1.5J4L55FNLN2CZZDV/contest/entry
+
|crumbs=[[API Home Page]] :: [[Contest API|Contest]]
-
+
|summary=Based on a profile ID, fetch that user's [[Enter Contest|contest entries]]. This will return a list of entries with information about the each.
-
HTTP 200 (OK)
+
|resource=/v1/{apikey}/profile/{profileId}.{webkey}/contest/entry
-
Cache-Control: public
+
|methods=GET
-
Connection: close
+
|resourceargs='''apikey''': Your [[API Key]].
-
Date: Sat, 10 Jul 2010 10:49:00 GMT
+
 
-
Server: POE HTTPD Component/0.09 (5.008008)
+
'''profileID'''.'''webkey''': ProfileID and WebKey from a profile URL. In this case, do not use the full URL and only the profileID and WebKey.
-
Content-Length: 533
+
|paramsrequired=None.
-
Content-Type: text/xml; charset=utf-8
+
}}
-
Expires: Mon, 26 Jul 2010 19:09:37 GMT
+
{{RESTfulExample
-
+
|title=Successfully fetch entries for a user
-
<?xml version="1.0" encoding="UTF-8" ?>
+
|summary=Demonstrates successful response
 +
|responsecode=200 OK
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
<result>
<result>
<entry>
<entry>
Line 19: Line 21:
<description></description>
<description></description>
<entry_id>1</entry_id>
<entry_id>1</entry_id>
-
<entry_state>transmuted</entry_state>
+
<entry_state>approved</entry_state>
<first_name>Todd</first_name>
<first_name>Todd</first_name>
<last_name>C</last_name>
<last_name>C</last_name>
-
<rating_ave>0.857</rating_ave>
+
<rating_ave>0.000</rating_ave>
-
<rating_count>7</rating_count>
+
<rating_count>0</rating_count>
<state>MI</state>
<state>MI</state>
<title>this is the title of my essay</title>
<title>this is the title of my essay</title>
<views>0</views>
<views>0</views>
-
<votes>1</votes>
+
<votes>0</votes>
 +
</entry>
 +
<entry>
 +
<body>this is also the body of my essay</body>
 +
<category>0</category>
 +
<city>livonia</city>
 +
<description>this is my description</description>
 +
<entry_id>3</entry_id>
 +
<entry_status>approved</entry_status>
 +
<first_name>brian</first_name>
 +
<last_name>Y</last_name>
 +
<rating_ave>0.000</rating_ave>
 +
<rating_count>0</rating_count>
 +
<state>MI</state>
 +
<title>title</title>
 +
<views>0</views>
 +
<votes>0</votes>
</entry>
</entry>
</result>
</result>
 +
}}
 +
{{RESTfulExample
 +
|title=Request entries for a non-existent user
 +
|summary=Demonstrates unsuccessful response
 +
|responsecode=404 Not Found
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result>
 +
<status>0</status>
 +
</result>
 +
}}

Current revision

API Home Page :: Contest

Summary

Based on a profile ID, fetch that user's contest entries. This will return a list of entries with information about the each.

Resource

/v1/{apikey}/profile/{profileId}.{webkey}/contest/entry

Valid Methods

GET

Resource Arguments

Note: resource arguments are always required.

apikey: Your API Key.

profileID.webkey: ProfileID and WebKey from a profile URL. In this case, do not use the full URL and only the profileID and WebKey.

Parameters Required

None.



Example: Successfully fetch entries for a user

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>
   <entry>
    <body>this is also the body of my essay</body>
    <category>0</category>
    <city>livonia</city>
    <description>this is my description</description>
    <entry_id>3</entry_id>
    <entry_status>approved</entry_status>
    <first_name>brian</first_name>
    <last_name>Y</last_name>
    <rating_ave>0.000</rating_ave>
    <rating_count>0</rating_count>
    <state>MI</state>
    <title>title</title>
    <views>0</views>
    <votes>0</votes>
   </entry>
 </result>


Example: Request entries for a non-existent user

Summary

Demonstrates unsuccessful response


Response

HTTP Status Code: 404 Not Found


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