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

KeyValueRequired
X-API-KEY
Your unique API keyYes
Content-Type
application/jsonYes

Request URL parameter

Parameter
Type
Required
Description
space
StringYesThis is the space name which is linked to the account

Post body parameters

Parameter
Type
Required
Description
name
StringYesName of the achievement
description
StringOptionalDescription of the achievement
initialState
IntegerYes

Informs the state of the achievement. Acceptable values are 1 or 0. Default value is 0

icon
StringYesA unique identifier for the Icon for Achievement. Achievement icon identifier retrieved from GET Achievement icons resource
ruleSets
Array [Object]Yes

Rule sets model. 


deprecated
BooleanYesA status of archived achievements. If true that means the achievement is archived. The default value is false (not archived)
dependantOn
Array [Object]OptionalAn Achievement link modelTypeRequiredDescription
achievementId
StringYesAn achievement identifier indicating which achievements will be dependant on the main achievement. Achievement identifier retrieved from GET Achievements resource
linkType
EnumYes

Accepted values "Must", "Should" or "Must-Not". 

minimumShouldMatch
IntegerYesA value indicating dependant on "Should" match - how many achievements will be dependant on with a linkType of should. Default value is 0
scheduling
ObjectYesA model of SchedulingTypeRequiredDescription
scheduleType
EnumYesAccepted values "Once", "Repeatedly", "Daily", "Weekly", "Monthly"
scheduleOccurrencesLimit
IntegerYesA 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
DateTimeYes

The start date and time of a schedule. The date and time is sent in UTC. 
 "
2019-11-05T12:41:00.000+0000

endDate
DateTimeOptional

The end date and time of a schedule. The date and time is sent in UTC. 
 "
2019-11-05T12:41:00.000+0000"

achievementLiveStatus
StringYes

A status of the Achievement. Acceptable values "Draft" or "Live"

category
Array [String]OptionalA list of categorised labels for the Achievements
memberGroups
Array [String]OptionalA list of member groups participating in the Achievement. If the field is left empty then the Achievement is open to ALL.
metadata
Array [Object]OptionalA list of MetaDataTypeRequiredDescription
key
StringYesIs a unique identifier.
value
StringYesThe data that is identified.
translations

Map [LanguageCode, Seq [Object]]

OptionalThe translations model.
*rewards
Array [Object]Optional

A model of a Reward.

ParameterTypeRequiredDescription
entityTypeStringYesThe value is "achievement"
entityIdStringYes

An achievement Id.

rewardRankStringYes

It associates with the rank of the leaderboard. 

rewardNameStringYesThe name of a reward
valueDoubleYesNumerical value of the reward that will be issued based on the reward type
rewardTypeStringYesReward type identifier retrieved from GET RewardTypes resource
descriptionStringOptionalThe description of a Reward 
delayIntegerOptionalDelay of issuing a reward in minutes. Default value is 0
memberAcknowledgmentRequiredBooleanYesRequires member acknowledgement to claim a reward. If set to true reward will not be automatically issued. Default is false.
metadataArray [Object]OptionalA list of MetadataTypeRequiredDescription
key
StringYesIs a unique identifier.
value
StringYesThe data that is identified.
period
IntegerOptionalReward available for a period of time from issuing. Value in minutes.
pointInTime
DateTimeOptional

Reward is available until a specific point in time

 2019-11-05T12:41:00.000+0000


CodeHTTP StatusDescriptionExample
2023409Rules cannot be empty
1002404
  • name value is empty;
  • name parameter was excluded;
  • icon value is empty;
  • icon parameter was excluded;
  • scheduleType value is empty or incorrect;
  • achievementLiveStatus value is empty or incorrect;

Rewards

  • rewardName was excluded;
  • rewardName is empty;
  • rewardRank was excluded;
  • entityId was excluded;
  • value was excluded;
  • rewardType was excluded;
  • description was excluded;
1008406rewardType value is empty
1007404The icon id is not in the system
1003406
  • initialState parameter is incorrect
  • Name is too long
  • Description is too long


1001400

deprecated value is incorrect