Skip to main content
Version: 5.7.0

GetGlobalLeaderboardPage

NOTE: The friend summary data is returned for each record in the leaderboard.

NOTE: "timeBeforeReset" is only returned when the requested version is also the active version.

Method returns a page of global leaderboard results.

Leaderboards entries contain the player's score and optionally, some user-defined data associated with the score.

tip

This method allows the client to retrieve pages from within the global leaderboard list

ServiceOperation
leaderboardGET_GLOBAL_LEADERBOARD_PAGE

Method Parameters

ParameterDescription
leaderboardIdThe id of the leaderboard
sortOrderSort order of page. ("HIGH_TO_LOW" or "LOW_TO_HIGH")
startIndexThe rank at which to start the page.
endIndexThe rank at which to end the page.

Usage

http://localhost:3000
string leaderboardId = "default";
SortOrder sortOrder = BrainCloudSocialLeaderboard.SortOrder.HIGH_TO_LOW;
int startIndex = 0;
int endIndex = 9;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.LeaderboardService.GetGlobalLeaderboardPage(leaderboardId, sortOrder, startIndex, endIndex, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"leaderboard": [
{
"playerId": "9073dff7-0df6-437e-9be6-39cd704dcoj4",
"score": 100,
"data": null,
"createdAt": 1401385959596,
"updatedAt": 1401385959596,
"index": 0,
"rank": 1,
"name": "",
"summaryFriendData": null,
"pictureUrl": null
},
{
"playerId": "7c107e9f-ab48-492d-a000-defec6237700",
"score": 10,
"data": null,
"rewarded": false,
"createdAt": 1401385898407,
"updatedAt": 1401385898407,
"index": 1,
"rank": 2,
"name": "",
"summaryFriendData": null,
"pictureUrl": null
}
],
"moreBefore": false,
"moreAfter": true,
"timeBeforeReset": 588182412,
"server_time": 1395840957588
}
}