Description:
Update a contest state to Cancel for a given ID.
Resource URL:
https://<apphost>.competitionlabs.com/api/<your-space-name>/competitions/<competitionId>/contests/<contestId>/manage/Cancel
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 |
EXAMPLE
Request Expand source
curl --header "X-API-KEY: <your-api-key>" --header "Content-Type: application/json" --request PUT https://app.competitionlabs.com/api/<your-space-name>/competitions/iLMexGUBOmEkXOJnG2MB/contests/n7MkxGUBOmEkXOJnoGMo/manage/Cancel -d '{}'
Response Expand source
{ "data": { "jsonClass": "Contest", "accountId": "QmTaPGUBsZyUBGOR_u9A", "competitionId": "iLMexGUBOmEkXOJnG2MB", "number": 0, "label": "12321", "description": "sdads", "termsConditions": "asdasd", "round": 1, "roundType": "TimeBound", "entrantsFromContest": [], "options": { "numberOfEntrants": { "jsonClass": "MaxMin", "maximum": 5, "minimum": 1 }, "products": [], "ruleSets": [ { "jsonClass": "RuleSet", "priority": 1, "scope": "contest", "action": "contest.points.calculated.by", "conditions": [ { "jsonClass": "MainConditionSet", "matchCondition": "All", "mustEvaluateTo": true, "rules": [ { "jsonClass": "MainRule", "fact": "event.action.type", "operator": "==", "constant": "login" } ] } ] }, { "jsonClass": "RuleSet", "priority": 2, "scope": "contest", "action": "open.contest", "conditions": [ { "jsonClass": "MainConditionSet", "matchCondition": "All", "mustEvaluateTo": true, "rules": [ { "jsonClass": "MainRule", "fact": "contest.parents.status", "operator": "==", "constant": "$finalised.status" } ] } ] }, { "jsonClass": "RuleSet", "priority": 3, "scope": "contest", "action": "finish.contest", "conditions": [ { "jsonClass": "MainConditionSet", "matchCondition": "All", "mustEvaluateTo": true, "rules": [ { "jsonClass": "MainRule", "fact": "contest.active.elapsed", "operator": ">", "constant": "500" } ] } ] }, { "jsonClass": "RuleSet", "priority": 4, "scope": "contest", "action": "finalise.contest", "conditions": [ { "jsonClass": "MainConditionSet", "matchCondition": "All", "mustEvaluateTo": true, "rules": [ { "jsonClass": "MainRule", "fact": "contest.finish.elapsed", "operator": ">=", "constant": "666666" } ] } ] } ], "isPublic": true, "autoStart": false, "autoStartRetryInterval": 1000, "autoStop": false, "autoStopRetryInterval": 1000, "scheduledDates": { "jsonClass": "StartEndDate", "start": "2018-09-12T18:11:27.000+00:00", "end": "2018-09-13T15:12:27.000+00:00" }, "actualDates": { "jsonClass": "StartEndDate" }, "optinRequiredForEntrants": false, "useGlobalEvents": false }, "created": "2018-09-10T15:40:59.304+00:00", "id": "n7MkxGUBOmEkXOJnoGMo", "translations": {}, "status": "Cancelled", "statusCode": 8, "translatableFields": [ "label", "description", "termsConditions" ] } }
ERROR CODES
Code | HTTP Status | Description | Example |
---|---|---|---|
503 | The contest Id was not found |
Error Response 503 Expand source
{ "status": 503 } |