Add Contest

From KickApps Documentation

Jump to: navigation, search

This is a Premium feature - Please contact your Account Manager or Sales Representative to best utilize this feature.

Adds a new contest to the site.

Contents

Authentication

Requires an Admin or Webmaster API Token.

Call Structure

http://api.kickapps.com/rest/contest/add/{asid}

URL Arguments

{asid} required The ID number of the KickApps community site that this media id is associated with. The {asid} is unique for each of the affiliate's sites.

HTTP Headers

HTTP Method must be POST with enctype="multipart/form-data"

Post Arguments

t required the user token generated via the "Create Token" API call. (Webmaster/Admin/Editor token only.)
name required, string The name of the contest. max 128 characters
description required,string A description of the contest. This will be viewable on the contest homepage by all community users. max 2048 characters.
rules required, string The rules of the contest. This will be viewable on the contest homepage by all community users. max 2048 characters.
contestMediaType required, string available options on the server. (Only one allowed) max 64 characters.
votingEnabled required, boolean Is community voting enabled for this contest? (Use case: Voting can be disabled for a moderator selected winner as opposed to a community selected winner.)
votingType string The type of voting that will be used. The available options are: thumbs, stars and vote. The default value is thumbs. This field will be validated against the list of available options on the server. (Votes method uses 1 star for a vote. Thumbs method uses 1 stars for thumbs down and 5 for thumbs up, star method uses 1->5 rating We’ll use the Bayesian rating (described above) to calculate the rating for each entry and rank them within the contest)
announceDate required, date The date on which the contest will show the contest name, descriptions and rules. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time
submissionStartDate required, date The date on which submissions will be accepted for the currently running contest. The contest will also switch from the default description to the "submissionPhaseUpdate" description. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time
submissionEndDate required, date The date on which new submissions will be locked from the currently running contest. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time
votingStartDate required, date The date on which the voting period starts for the contest. The contest will also switch from the "submissionPhaseUpdate" description to the "votingPhaseUpdate" description. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time.
votingEndDate required, date The date on which voting will be closed for the currently running contest. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time
winnerAnnounceDate required, date The date on which the contest will announce the contest winner. The contest will also switch from the "votingPhaseUpdate" description to the "overPhaseUpdate" description. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time
submissionPhaseUpdate required, string The description that will be replaced on the contest homepage when the submission phase start date is reached. max 2048 characters.
votingPhaseUpdate required, string The description that will be replaced on the contest homepage when the voting phase start date is reached. max 2048 characters.
overPhaseUpdate required, string The description that will be replaced on the contest homepage when the winner announce date is reached. max 2048 characters.
published required, boolean Is this Contest active / published in the system?
timeZone the timeszone in which the contest will take place. Defaults to EST.
locale locale to use for rendering date & time. Defaults to en_us.
callback string The name of your JavaScript callback function.
contestType integer The methodology we use when selecting a winner is determined by contest type. Defaults to:(1) automatic. (1) automatic: Based on highest rated entry, the winnerId and communityWinnerId contains the winner selected by community voting (these are identical). (2) manual: winnerId contains the winner manually selected, communityWinnerId contains the winner selected by community voting. A winner may not be a flagged contest entry.
tags string A comma delimited list of tags that describe the contest.
admintags string A comma delimited list of admin tags that describe the contest.
contestGraphic file A graphic for the contest. This field will upload the graphic as multipart mime form data, the image will be stored on the server and a link will be stored to the publicly viewable image.
restriction1 string Additional restriction field 1. [1-256 characters]
restriction2 string Additional restriction field 2. [1-256 characters]
restriction3 string Additional restriction field 3. [1-256 characters]
completed boolean defaults to false
winnerId defaults to 0
communityWinnerId defaults to 0

Response

Success

{
    "status": 1,
    "created": True,
    "contestId": "1234"
}

Failure

{
    "status": -1,
    "errorId": "123",
    "error": "Error Message"
}

Error Codes

1 Invalid Token
7 invalid value for field (must be true or false)
18 Insufficient user permissions for this operation.
26 field must be be from <X> to <Y> characters
27 Provided Time Zone/locale is Invalid.
28 Invalid field reason
29 Invalid Contest Type.
31 VotingType must be set to either votes, thumbs or stars.
32 field must be a valid POSIX time.
33 AnnounceDate must be less than or equal to submissionStartDate.
34 submissionStartDate must precede submissionEndDate.
35 submissionEndDate must be less than or equal to votingStartDate.
36 votingStartDate must precede votingEndDate.
37 votingEndDate must be less than or equal to winnerAnnounceDate.
38 winnerId doesn't match a valid entry (or not an int).
39 communityWinnerId doesn't match a valid entry (or not an int).
42 Invalid contest graphic.