Skip to main content
Version: 5.15.0

GetLeaderboards

public BackendLeaderboardTableReturnObject GetLeaderboards();

Description

Returns all user leaderboards generated in BACKND Console as a list.

  • This method cannot be called via SendQueue.

The list contains the following information:

  • Leaderboard name (title)
  • Leaderboard uuid (uuid)
  • Leaderboard creation date (inDate)
  • Leaderboard category (rankType)
  • Leaderboard cycle (date)
  • Initialization time (initializationTime)
  • Group categorization (isDivision)
  • Mail reward name (rewardPostTitle)
  • Whether to initialize data when initializing the leaderboard (isReset)
  • How to sort leaderboard (order)
  • Table used in the leaderboard (table)
  • Column used in the leaderboard (column)
  • Additional fields used in the leaderboard (extraDataColumn)
  • Data types of additional fields used in the leaderboard (extraDataType)

BackendLeaderboardTableReturnObject

public class BackendLeaderboardTableReturnObject : BackendReturnObject
{
public List<LeaderboardTableItem> GetLeaderboardTableList();
}

LeaderboardTableItem

public class LeaderboardTableItem
{
public string rankType;
public string date;
public bool isDivision;
public string uuid;
public string order;
public bool isReset;
public string title;
public string table;
public string column;

//Exists only for one-time rankings
public string rankStartDateAndTime;
public string rankEndDateAndTime;

//Exists only when there are additional fields
public string extraDataColumn;
public string extraDataType;

public Dictionary<string, string> rewardPostTitle = null;
}

Example

Synchronous

BackEnd.Leaderboard.BackendLeaderboardTableReturnObject bro = null;
bro = Backend.Leaderboard.User.GetLeaderboards();

foreach (BackEnd.Leaderboard.LeaderboardTableItem item in bro.GetLeaderboardTableList())
{
Debug.Log(item.ToString());
}

Asynchronous

Backend.Leaderboard.User.GetLeaderboards(bro => {
foreach (BackEnd.Leaderboard.LeaderboardTableItem item in bro.GetLeaderboardTableList())
{
string uuid = item.uuid;
Debug.Log(item.ToString());
}
});

ReturnCase

Success cases

When the lookup is successful
statusCode : 200
message : Success
returnValue : refer to GetReturnValuetoJSON

Error cases

If the leaderboard is missing
StatusCode : 404
ErrorCode : NotFoundException
Message : leaderboard not found, leaderboard cannot be found

GetReturnValuetoJSON

{
"rows": [
{
"rankType": "user", // Leaderboard type (user / guild)
"isDivision": true, // Group categorization
"rewardInDate": "2024-07-30T04:52:13.448Z",
"order": "desc", // Sorting order
"initializationTime": "04:00:00 UTC+9:00", // Leaderboard initialization time
"rankStartDateAndTime": "2024-08-19T15:40:00.000Z", // (Only for leaderboards that are one-time and not time-limited) Leaderboard start time
"rankEndDateAndTime": "2024-08-20T15:00:00.000Z", // (Only for leaderboards that are one-time) Leaderboard end time
// Ranking period
// day : daily
// week : weekly
// month : monthly
// infinity : accumulative ranking
// custom : one-time ranking
"date": "custom", //
"inDate": "2024-08-20T07:08:09.478Z", // Leaderboard creation date
"uuid": "01916e9d-5186-7594-b8ab-e286cefb6226",
"extraDataColumn": "Additional field column name", // (Only when additional field is selected) Additional field column name
"extraDataType": "S", // (Only when additional field is selected) Additional column data type
"isReset": true, // Whether to reset data when initializing
// Reward name by language
"rewardPostTitle": {
"ko": "Korean reward",
"en": "EnglishReward",
"fallback": "en"
},
"rewardName": "Reward chart name ",
"title": "Ranking title",
"table": "Table name used for ranking",
"column": "Column name used for ranking"
},
...
]
}