Enables scripted content fragments to use Leaderboards
Properties
Name | Access | Type | Description |
---|---|---|---|
ContentTypeId | Read | Guid | Content Type Id |
Current | Read | Leaderboard | Current |
Permissions | Read | LeaderboardPermissions | Permissions |
Methods
Create
Creates a leaderboard
Velocity
#set($leaderboardResponse = $core_v2_leaderboard.Create($name, $numberOfLeaders, "%{ ApplicationKey = $applicationKeyArg, ContainerId = $containerIdArg, Description = $descriptionArg, EndDate = $endDateArg, EndDisplayDate = $endDisplayDateArg, ExcludeRolesFilter = $excludeRolesFilterArg, IncludeRolesFilter = $includeRolesFilterArg, PeriodType = $periodTypeArg, StartDate = $startDateArg, StartDisplayDate = $startDisplayDateArg, TimeSpanType = $timeSpanTypeArg, TimeSpanValue = $timeSpanValueArg }"))
JavaScript
var leaderboardResponse = core_v2_leaderboard.Create(name, numberOfLeaders, { ApplicationKey: applicationKeyArg, ContainerId: containerIdArg, Description: descriptionArg, EndDate: endDateArg, EndDisplayDate: endDisplayDateArg, ExcludeRolesFilter: excludeRolesFilterArg, IncludeRolesFilter: includeRolesFilterArg, PeriodType: periodTypeArg, StartDate: startDateArg, StartDisplayDate: startDisplayDateArg, TimeSpanType: timeSpanTypeArg, TimeSpanValue: timeSpanValueArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
name | String | Name of leaderboard | Required | ||
numberOfLeaders | Int32 | Number of users to show on the leaderboard | Required | ||
options | Options | Set of optional parameters including: | Required | ||
ApplicationKey | String | Application Key for url. | Optional | ||
ContainerId | Guid | Filter points to those earned within a certain Container. Optional. | Optional | ||
Description | String | Description of the Leaderboard. | Optional | ||
EndDate | DateTime | Specify the earliest date scores will count for this leaderboard. StartDate and EndDate are required for Static period type. | Optional | ||
EndDisplayDate | DateTime | Only show the leaderboard on the site before this date. Optional, defaults to EndDate. | Optional | ||
ExcludeRolesFilter | String | Comma separated list of Site RoleIds. Used to limit the leaders for the leaderboard. Only users who are not assigned the provided site roles will be eligable to be on the leaderboard. | Optional | ||
IncludeRolesFilter | String | Comma separated list of Site RoleIds. Used to limit the leaders for the leaderboard. Only users assigned the provided site roles will be eligable to be on the leaderboard. | Optional | ||
PeriodType | String | Period Type | Optional | AllTime, Rolling, Static | |
StartDate | DateTime | Specify the earliest date scores will count for this leaderboard. StartDate and EndDate are required for Static period type. | Optional | ||
StartDisplayDate | DateTime | Only show the leaderboard on the site after this date. Optional, defaults to StartDate. | Optional | ||
TimeSpanType | String | Specify the time of time span for calculations (days/months/years). TimeSpanValue and TimeSpanType are required for Rolling period type | Optional | Day, Month, Year | |
TimeSpanValue | Int32 | Specify the number of (days/months/years), based on the TimeSpanType. TimeSpanValue and TimeSpanType are required for Rolling period type. | Optional |
Returns
Delete
Velocity
#set($additionalInfoResponse = $core_v2_leaderboard.Delete($leaderboardId))
JavaScript
var additionalInfoResponse = core_v2_leaderboard.Delete(leaderboardId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
leaderboardId | Int32 | Leaderboard Id | Required |
Returns
Get
Gets a leaderboard
Velocity
#set($leaderboardResponse = $core_v2_leaderboard.Get($leaderboardId))
JavaScript
var leaderboardResponse = core_v2_leaderboard.Get(leaderboardId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
leaderboardId | Int32 | Leaderboard Id | Required |
Returns
List
Velocity
#set($pagedListResponse = $core_v2_leaderboard.List("%{ ContainerId = $containerIdArg, ContentIds = $contentIdsArg, DisplayStatus = $displayStatusArg, NameQuery = $nameQueryArg, PageIndex = $pageIndexArg, PageSize = $pageSizeArg, PermissionId = $permissionIdArg, Scope = $scopeArg, SortBy = $sortByArg, SortOrder = $sortOrderArg }"))
JavaScript
var pagedListResponse = core_v2_leaderboard.List({ ContainerId: containerIdArg, ContentIds: contentIdsArg, DisplayStatus: displayStatusArg, NameQuery: nameQueryArg, PageIndex: pageIndexArg, PageSize: pageSizeArg, PermissionId: permissionIdArg, Scope: scopeArg, SortBy: sortByArg, SortOrder: sortOrderArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | Options | Set of optional parameters including: | Required | ||
ContainerId | Guid | Filter by Container to list group level leaderboards. Optional. If ContainerId is set, Scope is ignored and automatically set to 'Container'. | Optional | ||
ContentIds | String | Comma separated list of ContentIds. Used to limit to a specific set of leaderboards as well as sort order if SortBy is set to ContentIdsOrder. | Optional | ||
DisplayStatus | String | Filter by leaderboard display status. Optional. Possible values are (All, Displayed, Future, Past). | Optional | All, Displayed, Future, Past | |
NameQuery | String | Filter by leaderboard name. | Optional | ||
PageIndex | Int32 | Which page of leaderboards to return. Optional. | Optional | ||
PageSize | Int32 | Number of leaderboards to return per call. Optional. | Optional | ||
PermissionId | Guid | Used to get a list of leaderboards for which the current user has the provided Permission ID. | Optional | ||
Scope | String | Filter by leaderboard location. Optional. Possible values are (All, Global, Container). Ignored if ContainerId is specified. | Optional | All, Container, Global | |
SortBy | String | Accepted values are: Name (default), CreatedDate, ContentIdsOrder. Optional. | Optional | Name | ContentIdsOrder, CreatedDate, Name |
SortOrder | String | Accepted values are: Ascending or Descending (by name). Optional. | Optional | Ascending, Descending |
Returns
Update
Velocity
#set($leaderboardResponse = $core_v2_leaderboard.Update($leaderboardId, "%{ ApplicationKey = $applicationKeyArg, ContainerId = $containerIdArg, Description = $descriptionArg, EndDate = $endDateArg, EndDisplayDate = $endDisplayDateArg, ExcludeRolesFilter = $excludeRolesFilterArg, IncludeRolesFilter = $includeRolesFilterArg, Name = $nameArg, NumberOfLeaders = $numberOfLeadersArg, PeriodType = $periodTypeArg, StartDate = $startDateArg, StartDisplayDate = $startDisplayDateArg, TimeSpanType = $timeSpanTypeArg, TimeSpanValue = $timeSpanValueArg }"))
JavaScript
var leaderboardResponse = core_v2_leaderboard.Update(leaderboardId, { ApplicationKey: applicationKeyArg, ContainerId: containerIdArg, Description: descriptionArg, EndDate: endDateArg, EndDisplayDate: endDisplayDateArg, ExcludeRolesFilter: excludeRolesFilterArg, IncludeRolesFilter: includeRolesFilterArg, Name: nameArg, NumberOfLeaders: numberOfLeadersArg, PeriodType: periodTypeArg, StartDate: startDateArg, StartDisplayDate: startDisplayDateArg, TimeSpanType: timeSpanTypeArg, TimeSpanValue: timeSpanValueArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
leaderboardId | Int32 | Id of leaderboard | Required | ||
options | Options | Set of optional parameters including: | Required | ||
ApplicationKey | String | Application Key for url. | Optional | ||
ContainerId | Guid | Filter points to those earned within a certain Container. | Optional | ||
Description | String | Description of the Leaderboard. | Optional | ||
EndDate | DateTime | Specify the earliest date scores will count for this leaderboard. StartDate and EndDate are required for Static period type. | Optional | ||
EndDisplayDate | DateTime | Only show the leaderboard on the site before this date. Optional, defaults to EndDate. | Optional | ||
ExcludeRolesFilter | String | Comma separated list of Site RoleIds. Used to limit the leaders for the leaderboard. Only users who are not assigned the provided site roles will be eligable to be on the leaderboard. | Optional | ||
IncludeRolesFilter | String | Comma separated list of Site RoleIds. Used to limit the leaders for the leaderboard. Only users assigned the provided site roles will be eligable to be on the leaderboard. | Optional | ||
Name | String | Name of the Leaderboard. | Optional | ||
NumberOfLeaders | Int32 | Number of users to display on the leaderboard. | Optional | ||
PeriodType | String | Period Type | Optional | AllTime, Rolling, Static | |
StartDate | DateTime | Specify the earliest date scores will count for this leaderboard. StartDate and EndDate are required for Static period type. | Optional | ||
StartDisplayDate | DateTime | Only show the leaderboard on the site after this date. Optional, defaults to StartDate. | Optional | ||
TimeSpanType | String | Specify the time of time span for calculations (days/months/years). TimeSpanValue and TimeSpanType are required for Rolling period type | Optional | Day, Month, Year | |
TimeSpanValue | Int32 | Specify the number of (days/months/years), based on the TimeSpanType. TimeSpanValue and TimeSpanType are required for Rolling period type. | Optional |
Returns
UserIsEligible
Velocity
#set($booleanResponse = $core_v2_leaderboard.UserIsEligible($leaderboardId))
JavaScript
var booleanResponse = core_v2_leaderboard.UserIsEligible(leaderboardId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
leaderboardId | Int32 | Leaderboard Id | Required |
Returns
Boolean