Skip to main content
Version: 5.7.0

CreateLeaderboard

{
"packetId": 1,
"messages": [
{
"service": "leaderboard",
"operation": "CREATE_LEADERBOARD",
"data": {
"leaderboardId": "default",
"leaderboardType": "HIGH_VALUE",
"rotationType": "WEEKLY",
"rotationReset": "31-01-2015 15:00",
"rotationResetTime": 1437478586586,
"retainedCount": 2,
"data": {
"street": "1309 Carling"
}
}
}
]
}

Creates a leaderboard under the context of the current game. You can optionally send a user-defined json string of data with the created leaderboard. This string could include information relevant to the created leaderboard.

ServiceOperation
leaderboardCREATE_LEADERBOARD

Method Parameters

ParameterDescription
leaderboardIdA leaderboard id.
leaderboardTypeThe leaderboard type.
rotationTypeType of rotation.
rotationResetTimeDate to start the rotation (Date is in millis.)
retainedCountHow many previous rotations to keep.
numDaysToRotateHow many previous rotations to keep.
dataOptional user-defined data to post with the score.

Usage

http://localhost:3000
// S2S call: to view example, switch to the Cloud Code or Raw tab.
JSON Response
{
"packetId": 1,
"messageResponses": [
{
"status": 200,
"data": null
}
]
}