Enables scripted content fragments to use user achievements
Methods
Create
Add an achievement to a user
Velocity
#set($userAchievementResponse = $core_v2_userAchievement.Create($userId, $achievementId))
JavaScript
var userAchievementResponse = core_v2_userAchievement.Create(userId, achievementId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
userId | Int32 | User Id | Required | ||
achievementId | Guid | Achievement Id | Required |
Returns
Delete
Remove an achievement from a user
Velocity
#set($additionalInfoResponse = $core_v2_userAchievement.Delete($achievementId, $userId))
JavaScript
var additionalInfoResponse = core_v2_userAchievement.Delete(achievementId, userId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
achievementId | Guid | Achievement Id | Required | ||
userId | Int32 | User Id | Required |
Returns
Get
Get's a user's achievement
Velocity
#set($userAchievementResponse = $core_v2_userAchievement.Get($achievementId, $userId))
JavaScript
var userAchievementResponse = core_v2_userAchievement.Get(achievementId, userId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
achievementId | Guid | Achievement Id | Required | ||
userId | Int32 | User Id | Required |
Returns
List
List Overload 1
List achievements earned by a user
Velocity
#set($pagedListResponse = $core_v2_userAchievement.List($userId))
JavaScript
var pagedListResponse = core_v2_userAchievement.List(userId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
userId | Int32 | User Id | Required |
List Overload 2
List achievements earned by a user
Velocity
#set($pagedListResponse = $core_v2_userAchievement.List("%{ AchievementId = $achievementIdArg, BadgeIconUrl = $badgeIconUrlArg, CreatedAfterDate = $createdAfterDateArg, CreatedBeforeDate = $createdBeforeDateArg, Enabled = $enabledArg, PageIndex = $pageIndexArg, PageSize = $pageSizeArg, SortBy = $sortByArg, SortOrder = $sortOrderArg, UserId = $userIdArg }"))
JavaScript
var pagedListResponse = core_v2_userAchievement.List({ AchievementId: achievementIdArg, BadgeIconUrl: badgeIconUrlArg, CreatedAfterDate: createdAfterDateArg, CreatedBeforeDate: createdBeforeDateArg, Enabled: enabledArg, PageIndex: pageIndexArg, PageSize: pageSizeArg, SortBy: sortByArg, SortOrder: sortOrderArg, UserId: userIdArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | Options | Set of optional parameters including: | Required | ||
AchievementId | Int32 | Lists awarded users for this achievement | Optional | ||
BadgeIconUrl | String | Url to the icon representing the achievement | Optional | ||
CreatedAfterDate | DateTime | Filter to achievements awarded after this date | Optional | ||
CreatedBeforeDate | DateTime | Filter to achievements awarded before this date | Optional | ||
Enabled | Boolean | Enabled state of the achievement | Optional | ||
PageIndex | Int32 | Specify the page number of paged results to return. Zero-based index. | Optional | 0 | |
PageSize | Int32 | Specify the number of results to return per page. | Optional | 20 | |
SortBy | String | Sort mechanism | Optional | Title | DateCreated, Title |
SortOrder | String | Sort order | Optional | Ascending | Ascending, Descending |
UserId | Int32 | User to list achievements for | Optional |