POST /api/:space/competitions/:competitionId/contests

Description:

Create a contest for a specific Competition Identifier.

Resource URL:

https://<apphost>.competitionlabs.com/api/<your-space-name>/competitions/<competitionId>/contests

Request headers

KeyValueRequired
X-API-KEY
Your unique API keyYes
Content-Type
application/jsonYes

Request URL parameters

Parameter
Type
Required
Description
space
StringYesThis is the space name which is linked to the account
id
StringYesCompetition identifier retrieved from GET Competitions resource

Post body parameter

Parameter
Type
Required
Description
competitionId
StringYesCompetition identifier retrieved from GET Competitions resource
number
IntegerYesContests position e.g. if there are 2 Contests which one is first and which one is second. The default is 0
label
StringYesA name of the Contest
description
StringOptionalDescription of the Contest
termsConditions
StringOptionalTerms and conditions of a Contest
round
IntegerYesTo what round does the contest belong. The default is 1
roundType

String

YesType of rounds in a contest, eg. TimeBound
entrantsFromContest
Array [String]OptionalArray 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
ObjectYes



From Options domain model the only entries that are required:

TypeRequiredDescription
numberOfEntrants
From numberOfEntrants modelIntegerYesMaximum and Minimum number of entrants
minimumIntegerYesThe minimum number of entrants. The default is 1
maximumIntegerOptionalThe maximum number of entrants. Left empty means that no limitations are added
scheduledDates
From scheduleDates modelDateTimeYesStartEndDate model
startDateTimeYesTime and date of when the contest has to start. Example: 2019-09-24T14:25:00.000+00:00
endDateTimeYesTime and date of when the contest has to end. ISO8601 timestamp. Example: 2019-09-24T14:25:00.000+00:00
productsArray [Object]OptionalA list of Products
ruleSetsArray [Object]YesA list of RuleSets
autoStartBooleanOptionalTrue means that the contest will auto start depending on the scheduledDates
autoStopBooleanOptionalTrue means that the contest will auto stop depending on the scheduledDates
optinRequiredForEntrantsBooleanYesIf True, members must Opt in before they can acquire points in the contest
strategies
ObjectYesA Strategies model where you can change the Ranking and Scoring strategies
All the other entries
ObjectOptionalAll the other entries are optional to use
metadataArray [Object]OptionalA list of MetaData
statusStringNoA status of a contestCreating 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.
statusCodeIntegerNoA 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).
rewardsArray [Object]OptionalA model of a RewardTypeRequiredDescription
entityIdStringYesA contest Id. The string has to be left empty as it will populate automatically when the contest will be created
rewardRankStringYesIt associates with the rank of the leaderboard
rewardNameStringYesThe name of a reward
valueIntegerYesNumerical value of the reward that will be issued based on the reward type
rewardTypeStringYesReward type identifier retrieved from GET RewardTypes resource
descriptionStringOptionalThe description of a Reward 
delayIntegerOptionalDelay of issuing a reward in minutes
memberAcknowledgmentRequiredBooleanOptionalRequires member acknowledgment to claim a reward. If set to True reward will not be automatically issued
metadataArray [Object]OptionalA list of Metadata
pointInTimeDateTimeOptionalReward is available until a specific point in time

CodeHTTP StatusDescriptionExample

503competitionId parameter was empty;
1001400
  • competitionId parameter was excluded;
  • round parameter was excluded;
  • number parameter was excluded;
  • roundType parameter was excluded, empty or incorrect;
  • reward parameter was excluded;
  • optinRequiredForEntrants parameter was excluded
1017405
  • Contest operations not allowed for Competition currentStatus: Finished
  • Contest operations not allowed for Competition currentStatus: Cancelled