Enter Contest
From ePrize Developers Wiki
(→Entering a Contest) |
|||
Line 1: | Line 1: | ||
- | == | + | {{RESTfulAPI |
+ | |crumbs=[[API Home Page]] :: [[Contest API|Contest]] | ||
+ | |summary=Create a contest entry associated with this profile, specifying basic entry metadata such as a description and category. The [[API Key|API key]] will be preconfigured to expect a certain type of entry type (essay content, or binary image data). For binary image submissions, the form must be sent using Content-Type: multipart/form-data | ||
+ | |resource=/v1/{apikey}/contest/entry | ||
+ | |methods=POST | ||
+ | |resourceargs='''apikey''': Your [[API Key]]. | ||
+ | |paramsrequired='''body''': | ||
+ | '''category''': | ||
+ | '''description''' | ||
+ | }} | ||
- | Blank entry: | ||
- | + | ||
- | + | {{RESTfulExample | |
- | + | |title=Submitting a blank entry | |
- | + | |summary=Demonstrates validation errors on missing parameters | |
- | + | |request=profile: http://{client}.api.promo.eprize.com/v1/{apikey}/profile/{uid}.{webkey} | |
- | + | |responsecode=400 Bad Request | |
- | + | |response=<?xml version="1.0" encoding="UTF-8" ?> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
<result> | <result> | ||
<input_error> | <input_error> | ||
Line 40: | Line 40: | ||
</input_error> | </input_error> | ||
</result> | </result> | ||
+ | |extranotes=The {profile} value that is seen in the request of this call is the canonical URL of the profile that the entry is associated with. | ||
+ | }} | ||
- | + | {{RESTfulExample | |
- | + | |title=Submitting a entry successfully | |
- | + | |request=profile: http://{client}.api.promo.eprize.com/v1/{apikey}/profile/{uid}.{webkey} | |
- | + | body: "this is the body of my essay" | |
- | + | title: "this is the title of my essay" | |
- | + | original_work: yes | |
- | + | official_rules: yes | |
- | + | category: 1 | |
- | + | |responsecode=201 Created | |
- | + | |responseloc=/v1/{apikey}/contest/entry/{entryid} | |
- | + | |response=<?xml version="1.0" encoding="UTF-8" ?> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
<result> | <result> | ||
<entry> | <entry> | ||
Line 81: | Line 71: | ||
<votes>0</votes> | <votes>0</votes> | ||
</entry> | </entry> | ||
+ | </result>rror> | ||
</result> | </result> | ||
+ | |extranotes=The {profile} value that is seen in the request of this call is the canonical URL of the profile that the entry is associated with. | ||
+ | }} |
Revision as of 18:10, 19 April 2011
Summary
Create a contest entry associated with this profile, specifying basic entry metadata such as a description and category. The API key will be preconfigured to expect a certain type of entry type (essay content, or binary image data). For binary image submissions, the form must be sent using Content-Type: multipart/form-data
Resource
/v1/{apikey}/contest/entry
Valid Methods
POST
Resource Arguments
Note: resource arguments are always required.
apikey: Your API Key.
Parameters Required
body: category: description
Example: Submitting a blank entry
Summary
Demonstrates validation errors on missing parameters
Request
profile: http://{client}.api.promo.eprize.com/v1/{apikey}/profile/{uid}.{webkey}
Response
HTTP Status Code: 400 Bad Request
<?xml version="1.0" encoding="UTF-8" ?> <result> <input_error> <name>body</name> <error>NULL</error> </input_error> <input_error> <name>title</name> <error>NULL</error> </input_error> <input_error> <name>category</name> <error>NULL</error> </input_error> <input_error> <name>original_work</name> <error>NULL</error> </input_error> <input_error> <name>official_rules</name> <error>NULL</error> </input_error> </result>
Notes
The {profile} value that is seen in the request of this call is the canonical URL of the profile that the entry is associated with.
Example: Submitting a entry successfully
Request
profile: http://{client}.api.promo.eprize.com/v1/{apikey}/profile/{uid}.{webkey} body: "this is the body of my essay" title: "this is the title of my essay" original_work: yes official_rules: yes category: 1
Response
HTTP Status Code: 201 Created
HTTP Redirect Location: /v1/{apikey}/contest/entry/{entryid}
<?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>transmuted</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>rror> </result>
Notes
The {profile} value that is seen in the request of this call is the canonical URL of the profile that the entry is associated with.