POST /api/:space/achievements
Description:
Create Achievements and Achievements with Rewards attached to it using the CompetitionLabs API.
Resource URL:
https://<apphost>.competitionlabs.com/api/<your-space-name>/achievements
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 |
Post body parameters
Parameter | Type | Required | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
name | String | Yes | Name of the achievement | ||||||
description | String | Optional | Description of the achievement | ||||||
initialState | Integer | Yes | Informs the state of the achievement. Acceptable values are 1 or 0. Default value is 0 | ||||||
icon | String | Yes | A unique identifier for the Icon for Achievement. Achievement icon identifier retrieved from GET Achievement icons resource | ||||||
ruleSets | Array [Object] | Yes | |||||||
deprecated | Boolean | Yes | A status of archived achievements. If true that means the achievement is archived. The default value is false (not archived) | ||||||
dependantOn | Array [Object] | Optional | An Achievement link model | Type | Required | Description | |||
achievementId | String | Yes | An achievement identifier indicating which achievements will be dependant on the main achievement. Achievement identifier retrieved from GET Achievements resource | ||||||
linkType | Enum | Yes | Accepted values "Must", "Should" or "Must-Not". | ||||||
minimumShouldMatch | Integer | Yes | A value indicating dependant on "Should" match - how many achievements will be dependant on with a linkType of should. Default value is 0 | ||||||
scheduling | Object | Yes | A model of Scheduling | Type | Required | Description | |||
scheduleType | Enum | Yes | Accepted values "Once", "Repeatedly", "Daily", "Weekly", "Monthly" | ||||||
scheduleOccurrencesLimit | Integer | Yes | A value indicating how many times it will be issued. Default value is 1 | ||||||
every | Array [Integer] | Yes | A value for the parameter of the scheduleType that indicates the Daily, Weekly, Monthly repetition. Monthly values - January is 1, March is 3 and so on. | ||||||
startDate | DateTime | Yes | The start date and time of a schedule. The date and time is sent in UTC. | ||||||
endDate | DateTime | Optional | The end date and time of a schedule. The date and time is sent in UTC. | ||||||
achievementLiveStatus | String | Yes | A status of the Achievement. Acceptable values "Draft" or "Live" | ||||||
category | Array [String] | Optional | A list of categorised labels for the Achievements | ||||||
memberGroups | Array [String] | Optional | A list of member groups participating in the Achievement. If the field is left empty then the Achievement is open to ALL. | ||||||
metadata | Array [Object] | Optional | A list of MetaData | Type | Required | Description | |||
key | String | Yes | Is a unique identifier. | ||||||
value | String | Yes | The data that is identified. | ||||||
translations | Map [LanguageCode, Seq [Object]] | Optional | The translations model. | ||||||
*rewards | Array [Object] | Optional | A model of a Reward. | ||||||
Parameter | Type | Required | Description | ||||||
entityType | String | Yes | The value is "achievement" | ||||||
entityId | String | Yes | An achievement Id. | ||||||
rewardRank | String | Yes | It associates with the rank of the leaderboard. | ||||||
rewardName | String | Yes | The name of a reward | ||||||
value | Double | 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. Default value is 0 | ||||||
memberAcknowledgmentRequired | Boolean | Yes | Requires member acknowledgement to claim a reward. If set to true reward will not be automatically issued. Default is false. | ||||||
metadata | Array [Object] | Optional | A list of Metadata | Type | Required | Description | |||
key | String | Yes | Is a unique identifier. | ||||||
value | String | Yes | The data that is identified. | ||||||
period | Integer | Optional | Reward available for a period of time from issuing. Value in minutes. | ||||||
pointInTime | DateTime | Optional | Reward is available until a specific point in time 2019-11-05T12:41:00.000+0000 |
Code | HTTP Status | Description | Example |
---|---|---|---|
2023 | 409 | Rules cannot be empty | |
1002 | 404 |
Rewards
| |
1008 | 406 | rewardType value is empty | |
1007 | 404 | The icon id is not in the system | |
1003 | 406 |
| |
1001 | 400 |
|