API reference

Leaderboards Class

The Leaderboards API provides a way to manage and interact with leaderboards in your application. The API allows you to retrieve information about a single leaderboard, write entries to a leaderboard, and retrieve blocks of leaderboard entries based on different criterias. Leaderboard-integrated apps get Challenges for free, accessible through the Scoreboards UI. Visit our website for more information about leaderboards.

Static Methods

get ( leaderboardName )
Retrieves detailed information for a single leaderboard with a specified name, returning an array of com.meta.horizon.platform.ovr.models.Leaderboard.
Signature
static Request<com.meta.horizon.platform.ovr.models.LeaderboardArray> com.meta.horizon.platform.ovr.requests.Leaderboards.get(String leaderboardName)
Parameters
leaderboardName: String  - The name of the leaderboard to retrieve.
getEntries ( leaderboardName , limit , filter , startAt )
Retrieves a list of leaderboard entries for a specified leaderboardName, with options to filter and limit the number of results returned.
Signature
static Request<com.meta.horizon.platform.ovr.models.LeaderboardEntryArray> com.meta.horizon.platform.ovr.requests.Leaderboards.getEntries(String leaderboardName, int limit, LeaderboardFilterType filter, LeaderboardStartAt startAt)
Parameters
leaderboardName: String  - The name of the leaderboard from which to retrieve entries.
limit: int  - Specifies the maximum number of entries to be returned.
filter: LeaderboardFilterType  - By using ovrLeaderboard_FilterFriends, this allows you to filter the returned values to bidirectional followers.
startAt: LeaderboardStartAt  - Defines whether to center the query on the user or start at the top of the leaderboard.
getEntriesAfterRank ( leaderboardName , limit , afterRank )
Retrieves a block of leaderboard entries starting from a specific rank.
Signature
static Request<com.meta.horizon.platform.ovr.models.LeaderboardEntryArray> com.meta.horizon.platform.ovr.requests.Leaderboards.getEntriesAfterRank(String leaderboardName, int limit, long afterRank)
Parameters
leaderboardName: String  - The name of the leaderboard from which to retrieve entries.
limit: int  - The maximum number of entries to return.
afterRank: long  - The position after which to start. For example, 10 returns leaderboard results starting with the 11th user.
getEntriesByIds ( leaderboardName , limit , startAt , userIDs )
Retrieves a block of leaderboard entries that match the specified user IDs. Only entries corresponding to the provided user IDs will be returned.
Signature
static Request<com.meta.horizon.platform.ovr.models.LeaderboardEntryArray> com.meta.horizon.platform.ovr.requests.Leaderboards.getEntriesByIds(String leaderboardName, int limit, LeaderboardStartAt startAt, long[] userIDs)
Parameters
leaderboardName: String  - The name of the leaderboard from which to retrieve entries.
limit: int  - The maximum number of entries to return.
startAt: LeaderboardStartAt  - Defines whether to center the query on the user or start at the top of the leaderboard. If this is com.meta.horizon.platform.ovr.enums.LeaderboardStartAt#CenteredOnViewer or com.meta.horizon.platform.ovr.enums.LeaderboardStartAt#CenteredOnViewerOrTop, then the current user's ID will be automatically added to the query.
userIDs: long []  - Defines a list of user ids to get entries for.
writeEntry ( leaderboardName , score , extraData , forceUpdate )
Writes a single entry to the leaderboard, returning com.meta.horizon.platform.ovr.models.LeaderboardUpdateStatus indicating whether the update was successful and providing the updated challenge IDs.
Signature
static Request<Boolean> com.meta.horizon.platform.ovr.requests.Leaderboards.writeEntry(String leaderboardName, long score, byte[] extraData, boolean forceUpdate)
Parameters
leaderboardName: String  - The name of the leaderboard to which the entry should be written.
score: long  - The score to be written in the leaderboard.
extraData: byte []  - A 2KB custom data field that is associated with the leaderboard entry. This can be a game replay or any additional information that provides more context about the entry for the viewer.
forceUpdate: boolean  - If true, the score always updates. This happens even if it is not the user's best score.
Returns
Request< Boolean >
writeEntryWithSupplementaryMetric ( leaderboardName , score , supplementaryMetric , extraData , forceUpdate )
Writes a single entry to a leaderboard which can include supplementary metrics, returning com.meta.horizon.platform.ovr.models.LeaderboardUpdateStatus indicating whether the update was successful and providing the updated challenge IDs.
Signature
static Request<Boolean> com.meta.horizon.platform.ovr.requests.Leaderboards.writeEntryWithSupplementaryMetric(String leaderboardName, long score, long supplementaryMetric, byte[] extraData, boolean forceUpdate)
Parameters
leaderboardName: String  - The name of the leaderboard to which the entry should be written.
score: long  - The score to be written in the leaderboard.
supplementaryMetric: long  - Supplemental piece of data that can be used for tiebreakers.
extraData: byte []  - A 2KB custom data field that is associated with the leaderboard entry. This can be a game replay or any additional information that provides more context about the entry for the viewer.
forceUpdate: boolean  - If true, the score always updates. This happens even if it is not the user's best score.
Returns
Request< Boolean >