Hi Anders,
Apologies for the inconvenience
There is some documentation mistake, please use getTopNRankersBetweenDate() please find below the code snippet to fetch the required data from the leaderboard.
function getTopNRankersBetweenDate(){
var max =1;
var gameName = "STARCRICKET";
var startDate = null; /* Get date from your source */
var endDate = null; /* Get date from your source */
var result ;
App42.initialize("145152e917af6f19a7d09c40d3b4e359fe8a5c321b1dc0f83a8bd03560cea96e","b53cef7465035288b87a4bfcb5a3ccae6355b0daa536e5dcc60decdd636d8066");
var scoreBoardService = new App42ScoreBoard();
scoreBoardService.getTopNRankersBetweenDate(gameName,startDate,endDate,max,{
success: function(object)
{
var game = JSON.parse(object);
result = game.app42.response.games.game;
console.log("gameName is : " + result.name)
var scoreList = result.scores.score;
if (scoreList instanceof Array) {
for (var i = 0; i < scoreList.length; i++) {
console.log("userName is : " + scoreList[i].userName)
console.log("scoreId is : " + scoreList[i].scoreId)
console.log("value is : " + scoreList[i].value)
}
} else {
console.log("userName is : " + scoreList.userName)
console.log("scoreId is : " + scoreList.scoreId)
console.log("value is : " + scoreList.value)
}
},
error: function(error) {
}
});
}
In case if you have any other queries please do feel free to reach out to us.
We will be happy to help you.
Regards,
Priyanka Singh
App42 Team