POST design-challenges

Create a new Design Challenge. Besides the information of the challenge itself, you must also specify the rewards for both winning and participating in the challenge, each of which gets an achievement and an emblem reward.

Example

POST /api/v1/design-challenges HTTP/1.1
Content-Type: application/json
Authorization: Bearer ...

{
  "name": "Second Challenge",
  "ordinal": 2,
  "theme": "Second Testing",
  "description": "This is also a test challenge!",
  "win": {
    "achievement": {
      "key": "second-win",
      "name": "Won Second Challenge",
      "description": "Won the Second Challenge!",
      "visibilityStart": null,
      "visibilityStop": null
    },
    "emblem": {
      "name": "Won Second Challenge",
      "description": "Won Second Challenge",
      "image": "second-win-emblem.jpg",
      "color": "#0000ff"
    }
  },
  "participate": {
    "achievement": {
      "key": "second-participated",
      "name": "Participated in Second Challenge",
      "description": "Participated in the Second Challenge!",
      "visibilityStart": null,
      "visibilityStop": null
    },
    "emblem": {
      "name": "Participated in Second Challenge",
      "description": "Participated in Second Challenge",
      "image": "second-participated-emblem.jpg",
      "color": "#00ff00"
    }
  }
}
----------------------------------------
HTTP/1.1 201 Created
Location: /design-challenge/5

Security

Authentication is required and access is restricted to admins.

URL Parameters

NONE

Query Parameters

NONE

Request Body

NameDescriptionValue
namethe display namestring
ordinala numerical ordering for challengesnumber
descriptionthe descriptionstring
themea short descriptor for the theme of the challengestring
winthe achievement and emblem info for winning the challengeRewardDefinition
participatethe achievement and emblem info for participating in the challengeRewardDefinition

RewardDefinition

NameDescriptionValue
achievementachievement definitionAchievementDefinition
emblememblem definitionEmblemDefinition

AchievementDefinition

NameDescriptionValue
keythe key of this achievementstring
namethe name of the achievementstring
descriptionthe description of the achievementstring
visibilityStartif not null, the time after which this achievement should be generally visible; as a Unix timestampnumber or null
visibilityStopif not null, the time after whcih this achievement should be no longer visible; as a Unix timestampnumber or null

EmblemDefinition

NameDescriptionValue
namethe name of the emblemstring
descriptionthe description of the emblemstring
imagethe path to a media bucket image for the emblemstring
colorthe color of the emblemstring

Response

Successful responses are code 201 with a Location header containing the newly created ID. Error responses are standard.

Response Body

NONE