Select Contest Winner

From KickApps Documentation

Jump to: navigation, search
This method is an admin method that selects a winner for a given contest in the BET community. This method will require a webmaster / moderator token. The methodology we use when selecting a winner is determined by contest type.
  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.

Contents

Authentication

Requires an Admin or Webmaster API Token.

Call Structure

http://api.kickapps.com/rest/contest/selectwinner/{as}

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

Post Arguments

t string,required the user token generated via the "Create Token" API call.
contestId int,required The ID of the contest.
contestEntryId int,required The ID of the contest entry. (Manually selected winner, not community winner. Should be a 0 when the manual winner will not be picked as a result of this call.)
callback string The name of your JavaScript callback function.

Response

Success

{
    "status": 1,
    "contestId": "1234",
    "winnerId": "4567"
}

Failure

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

Error Codes

1 Invalid Token
18 Insufficient user permissions for this operation.
26 field must be be from <X> to <Y> characters
30 winnerType must be set to either Manual or Automatic
39 communityWinnerId doesn't match a valid entry (or not an int).
40 contestId not found (or not an int).
41 contestEntryId not found (or not an int)
44 token required
52 Contest not published, contest entry rejected
53 contestId and contestEntryId mismatch
76 A contest winner cannot be selected while voting is still active.
80 communityWinnerId invalid
83 Contest Winner selection failed: ContestEntryId not published
84 Contest not published, contest winner cannot be selected