Description:
Update a contest for a given ID.
A reward can not be updated with a contest. All the rewards that need to be updated within a contest have to be deleted by inserting the reward Id in the "deleteRewards" parameter and new ones will be created by inserting the reward model in the "rewards" parameter.
Resource URL:
https://<apphost>.competitionlabs.com/api/<your-space-name>/competitions/<competitionId>/contests/<contestId>
Request header
Key | Value | Required |
X-API-KEY | Your unique API key | Yes |
Content-Type | application/json | Yes |
Request URL parameter
Parameter | Type | Required | Description |
---|---|---|---|
space | String | Yes | This is the space name which is linked to the account |
competitionId | String | Yes | Competition identifier retrieved from GET Competitions resource |
contestId | String | Yes | Contest identifier retrieved from GET contests request |
Put body parameter
Parameter | Type | Required | Description | ||||
---|---|---|---|---|---|---|---|
competitionId | String | Yes | Competition identifier retrieved from GET Competitions resource | ||||
number | Integer | Yes | Contests position e.g. if there are 2 Contests which one is first and which one is second. The default is 0 | ||||
label | String | Yes | A name of the Contest | ||||
description | String | Optional | Description of the Contest | ||||
termsConditions | String | Optional | Terms and conditions of a Contest | ||||
round | Integer | Yes | To what round does the contest belong. The default is 1 | ||||
roundType | String | Yes | Type of rounds in a contest, eg. TimeBound | ||||
entrantsFromContest | Array [String] | Optional | Array of Strings to identify which entrants will progress to next contest, for the first round the value should be 0 or can be left empty | ||||
options | Object | Yes | From Options domain model the only entries that are required: | Type | Required | Description | |
numberOfEntrants | From numberOfEntrants model | Integer | Yes | Maximum and Minimum number of entrants | |||
minimum | Integer | Yes | The minimum number of entrants. The default is 1 | ||||
maximum | Integer | Optional | The maximum number of entrants. Left empty means that no limitations are added | ||||
scheduledDates | From scheduleDates model | DateTime | Yes | StartEndDate model | |||
start | DateTime | Yes | Time and date of when the contest has to start. Example: 2019-09-24T14:25:00.000+00:00 | ||||
end | DateTime | Yes | Time and date of when the contest has to end. ISO8601 timestamp. Example: 2019-09-24T14:25:00.000+00:00 | ||||
products | Array [Object] | Optional | A list of Products | ||||
ruleSets | Array [Object] | Yes | A list of RuleSets | ||||
autoStart | Boolean | Optional | True means that the contest will auto start depending on the scheduledDates | ||||
autoStop | Boolean | Optional | True means that the contest will auto stop depending on the scheduledDates | ||||
optinRequiredForEntrants | Boolean | Yes | If True, members must Opt in before they can acquire points in the contest | ||||
All the other entries | Object | Optional | All the other entries are optional to use | ||||
metadata | Array [Object] | Optional | A list of MetaData | ||||
status | String | No | A status of a contest. Creating a contest in a competition that hasn't been started yet the contest is automatically set to NotStarted or creating a contest in a competition that has already been started then the contest is set to Active. | ||||
statusCode | Integer | No | A status of a contest defined as a number. Creating a contest in a competition that hasn't been started yet the contest is automatically set to 0 (NotStarted) or creating a contest in a competition that has already been started then the contest is set to 3 (Active). | ||||
reward | Array [Object] | Optional | A model of a Reward | Type | Required | Description | |
entityId | String | Yes | A contest Id. The string has to be left empty as it will populate automatically when the contest will be created | ||||
rewardRank | String | Yes | It associates with the rank of the leaderboard | ||||
rewardName | String | Yes | The name of a reward | ||||
value | Integer | Yes | Numerical value of the reward that will be issued based on the reward type | ||||
rewardType | String | Yes | Reward type identifier retrieved from GET RewardTypes resource | ||||
description | String | Optional | The description of a Reward | ||||
delay | Integer | Optional | Delay of issuing a reward in minutes | ||||
memberAcknowledgmentRequired | Boolean | Optional | Requires member acknowledgment to claim a reward. If set to True reward will not be automatically issued | ||||
metadata | Array [Object] | Optional | A list of Metadata | ||||
pointInTime | DateTime | Optional | Reward is available until a specific point in time |
EXAMPLE
ERROR CODES
Code | HTTP Status | Description | Example |
---|---|---|---|
1007 | 404 | Contest with CL-contestId not found. | |
1001 | 400 |
| |
| |||
2023 | 409 | Rules cannot be empty | |
3008 | 412 |
| |
503 | scheduleDate parameter was excluded; |