Here you can find all the Rule sets combinations for a Contest creation POST via API. The Contest has to have at least 4 rule sets with actions that are contest start, finish, finalise and points calculation.
This page is for reference only to display all the possible rules combinations.
You can not create a contest only with rules parameters. All other POST body parameters that are required for a contest creation must exist.
You can find the rest of the POST body parameters needed to create a contest here
Resource URL:
https://<apphost>.competitionlabs.com/api/<your-space-name>/competitions/<competitionId>/contests
Request headers
Key | Value | Required |
---|---|---|
X-API-KEY | Your unique API key | Yes |
Content-Type | application/json | Yes |
Request URL parameters
Parameter | Type | Required | Description |
---|---|---|---|
space | String | Yes | This is the space name which is linked to the account |
id | String | Yes | Competition identifier retrieved from GET Competitions resource |
Post body ruleSets parameter
Parameter | Type | Required | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ruleSets | Array [Object] | Yes | A list of RuleSets | Type | Required | Description | |||||||||||||
priority | Integer | Yes | A value to display the rules in order | ||||||||||||||||
scope | String | Yes | What model it belongs to for example contest or achievement | ||||||||||||||||
onMatchThen | String | Optional | Only Required when "Custom points" action is selected | ||||||||||||||||
onMatchConstant | String | Optional | Only Required when "Custom points" action is selected. It’s a value that represent how many points will be added, subtracted or multiplied. | ||||||||||||||||
action | String | Yes | Displays the rule set. | ||||||||||||||||
conditions | Array [Object] | Yes | MainConditionSet model. | Type | Required | Description | |||||||||||||
matchCondition | Enum
| Yes | Whether the rules must all evaluate as True or False or at least one of the rules must be True or False to satisfy the rule | ||||||||||||||||
mustEvaluateTo | Boolean | Yes | The value the rule(s) must evaluate to for the rule to be satisfied | ||||||||||||||||
rules | Array [Object] | Yes | MainRule model. | Type | Required | Description | |||||||||||||
fact | String | Yes | Displays the facts of the rule. | ||||||||||||||||
operator | String | Yes | Part of the rule which operates the fact ex. is, more than, less than etc. | ||||||||||||||||
constant | String | Yes | A rules value that defines the fact ex. if the fact is "the action" then the constant is "win". Some constants are pre defined (they are called macros) All the other constants are variables. | ||||||||||||||||
subConditions | Array [Object] | Optional | subConditionSet model. Works the same as Main condition set model. Within the subConditionSet model you will find all the relevant and needed sub conditions for posting Example "jsonClass": "SubConditionSet", "matchCondition": "All", "mustEvaluateTo": true, "subRules": [ { "jsonClass": "SubRule", "fact": "event.action.type", "operator": "==", "constant": "bet" All the valid "SubRule" facts are the same as above in conditions → rules → fact and All the valid "SubRule" operators are the same as above in conditions → rules → operator |
EXAMPLE