Add Contest Entry
From KickApps Documentation
This method adds a contest entry to a given contest (by contestId). This method is publicly accessible, as it will be need to be called when a user submits an entry to a contest in the member facing site. Note: A contest entry can either be submitted for a userId provided the token is either the user's or belongs to the webmaster/admin or editor of the site. If the token provided is an webmaster/admin token, a contest entry can be added at any time regardless of entry submission dates or contest published status.
Authentication
This method requires a authenticated user token from any type of user.
Call Structure
http://api.kickapps.com/rest/contestentry/add/{asid}
URL Arguments
|
|
|
| {asid}
| required
| The site Id to search. as is unique for each of the affiliate's sites.
|
HTTP Method must be POST
Post Arguments
|
|
|
| t
| string,required
| the user token generated via the "Create Token" API call.
|
| contestId
| int,required
| The ID of the contest.
|
| user_id
| int,required
| The ID of the user who submitted this entry.
|
| mediaId
| int,required
| The id of a media object that’s not yet associated with a contest (Note: The mediaObject’s votes will be reset to zero and it cannot have been submitted to any previous contests.)
|
| mediaType
| string,required
| The media type of the item being referenced in the feed. The available options are: audio, video, photo
|
| published
| bool, required
| Is this entry published?
|
| callback
| string
| The name of your JavaScript callback function.
|
| communityRank
| int
| Rank of this entry based on community voting and the Bayesian Ranking (This will be calculated, defaults to 0)
|
| rank
| int
| rank of this entry as selected by the site administrator (defaults to 0)
|
Response
Success
{
"status": 1,
"created": true,
"contestEntryId": "1234"
}
Failure
{
"status": -1,
"errorId": "123",
"error": "Error Message"
}
Error Codes
|
|
| 1
| Invalid Token
|
| 7
| invalid value for field (must be true or false)
|
| 1
| communityRank must be a positive integer, or is missing
|
| 13
| invalid userId
|
| 18
| Insufficient user permissions for this operation.
|
| 26
| field must be be from <X> to <Y> characters
|
| 40
| contestId not found (or not an int).
|
| 43
| Invalid media reference
|
| 44
| token required
|
| 48
| User is either disabled or blocked
|
| 51
| Not in contest entry period (voting not begun/over), Media rating rejected
|
| 52
| Contest not published, contest entry rejected
|
| 64
| mediaId already entered into this contest
|
| 65
| mediaId already entered into this contest
|
| 71
| mediaId is not valid for this site
|
| 72
| mediaId must reference an approved media object
|