Description:
Update achievement details in the CompetitionLabs system for a given achievement identifier.
By updating the achievement and leaving the parameter empty - means that the updated achievement will have the field updated to an empty field.
By updating the achievements parameter achievementLiveStatus to Live - the achievement will not be editable anymore. Only achievements that are in Draft status can be edited!
A reward can not be updated with an achievement. All the rewards that need to be updated within an achievement have to be deleted by inserting the reward Id in the "deleteRewards" parameter and new ones will be created by inserting the reward model in the "rewards" parameter.
The reward Id's for the parameter "deleteRewards" can be found using this URL
https://<apphost>.competitionlabs.com/api/<your-space-name>/reward/entity/<achievementId>
Resource URL:
https://<apphost>.competitionlabs.com/api/<your-space-name>/achievements/<achievementId>
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 |
id | String | Yes | Achievement identifier retrieved from GET Achievements resource |
Put body parameters
Parameter | Type | Required | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
name | String | Yes | Name of the achievement | ||||||
description | String | Yes | 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 | A Rule sets model. Rule sets POST body parameters can be found in Achievement rules. | ||||||
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] | Yes | 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". You can read more about dependencies here | ||||||
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" (Enum values - "Daily", "Weekly", "Monthly" - DISCONTINUED) | ||||||
scheduleOccurrencesLimit (DISCONTINUED) | Integer | Yes | A value indicating how many times it will be issued. Default value is 1 | ||||||
every (DISCONTINUED) | Array [Integer] | Yes | A value for the parameter of the scheduleType that indicates the Daily, Weekly, Monthly repetition. EXAMPLE 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. DateTime type parameters have an ISO8601 timestamp | ||||||
endDate | DateTime | Optional | The end date and time of a schedule. The date and time is sent in UTC. DateTime type parameters have an ISO8601 timestamp | ||||||
achievementLiveStatus | String | Yes | A status of the Achievement. Acceptable values "Draft" or "Live" By editing the achievement to a Live status - the achievement will not be editable anymore. Only achievements that are in Draft status can be edited! | ||||||
category | Array [String] | Yes | A list of categorised labels for the Achievements | ||||||
memberGroups | Array [String] | Yes | 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] | Yes | 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]] | Yes | The translations model. | ||||||
| id | String | Yes | Achievement identifier retrieved from GET Achievements resource | ||||||
deleteRewards | Array [String] | Yes | A list of reward Id's. A reward can not be updated. It must be deleted first and then created again. The reward Id's can be found using this URL https://<apphost>.competitionlabs.com/api/<your-space-name>/reward/entity/<achievementId> | ||||||
*rewards | Array [Object] | Yes | A model of a Reward. *Multiple rewards can be created at the same time. No rewards added to the achievement means that the achievement is created without rewards | ||||||
| Parameter | Type | Required | Description | ||||||
entityType | String | Yes | The value is "achievement" | ||||||
entityId | String | Yes | An achievement Id. The string has to be left empty as it will populate automatically when the achievement will be created | ||||||
rewardRank | String | Yes | It associates with the rank of the leaderboard. The string has to be left empty as the achievement doesn’t need to have a ranking system. | ||||||
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 EXAMPLE 2019-11-05T12:41:00.000+0000 DateTime type parameters have an ISO8601 timestamp | ||||||
EXAMPLE
ERROR CODES
| Code | HTTP Status | Description | Example |
|---|---|---|---|
| 1007 | 404 | A record with requested id was not found | |
| 1001 | 400 | name parameter was excluded | |
| 2023 | 409 | Rules cannot be empty | |
| 6001 | 406 | Updating a Live achievement |