Get All Contest Entries for a Profile
From ePrize Developers Wiki
(Difference between revisions)
(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...) |
|||
(One intermediate revision not shown.) | |||
Line 1: | Line 1: | ||
- | + | {{RESTfulAPI | |
- | + | |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. | |
- | + | |resource=/v1/{apikey}/profile/{profileId}.{webkey}/contest/entry | |
- | + | |methods=GET | |
- | + | |resourceargs='''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. | |
- | + | |paramsrequired=None. | |
- | + | }} | |
- | + | {{RESTfulExample | |
- | + | |title=Successfully fetch entries for a user | |
- | + | |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> | + | <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. | + | <rating_ave>0.000</rating_ave> |
- | <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> | + | <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
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>