Skip to main content
Version: 5.7.0

PostTournamentScoreWithResultsUTC

Post the users score to the tournament leaderboard, and returns updated standings.

tRank will always be zero in the response of this API call. The value generates after the tournament is complete or on ViewCurrentReward.

ServiceOperation
tournamentPOST_TOURNAMENT_SCORE_WITH_RESULTS

Method Parameters

ParameterDescription
leaderboardIdThe leaderboard for the tournament
scoreThe score to post
jsonDataOptional data attached to the leaderboard entry
roundStartedTimeTime the user started the match resulting in the score being posted (in millis UTC)
sortSort key Sort order of page. ("HIGH_TO_LOW" or "LOW_TO_HIGH")
beforeCountThe count of number of players before the current player to include.
afterCountThe count of number of players after the current player to include.
initialScoreThe initial score for players first joining a tournament. Usually 0, unless leaderboard is LOW_VALUE.

Usage

http://localhost:3000
string leaderboardId = "leaderboardId1";
int score = 0;
string jsonData = "{\"nickname\":\"withResults\"}";
DateTime roundStartedTime = DateTime.Now;
SortOrder sortOrder = SortOrder.HIGH_TO_LOW;
int beforeCount = 3;
int afterCount = 4;
int initialScore = 0;
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.TournamentService.PostTournamentScoreWithResultsUTC(leaderboardId, score, jsonData, roundStartedTime, sortOrder, beforeCount, afterCount, initialScore, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"postScore": {
"createdAt": 1484937347793,
"data": null,
"leaderboardId": "testTournamentLeaderboard",
"playerId": "d271327b-0c33-45cf-8f5f-a62904aae5fb",
"previousLeaderboard": {
"createdAt": 1484937347793,
"data": null,
"index": 0,
"name": "UserA_CPP_23167710",
"pictureUrl": "https://some.domain.com/mypicture.jpg",
"playerId": "d271327b-0c33-45cf-8f5f-a62904aae5fb",
"rank": 1,
"score": 100,
"summaryFriendData": {
"field": "value"
},
"tCode": "testTournament",
"tNotifiedAt": 0,
"tRank": 0,
"updatedAt": 1484937347793
},
"previousScore": 100,
"score": 100,
"tClaimedAt": 0,
"tCode": "testTournament",
"tNotifiedAt": 0,
"tRank": 0,
"updatedAt": 1484937348565,
"versionId": 18
},
"scores": [
{
"createdAt": 1484937347793,
"data": null,
"index": 0,
"name": "UserA_CPP_23167710",
"pictureUrl": "https://some.domain.com/mypicture.jpg",
"playerId": "d271327b-0c33-45cf-8f5f-a62904aae5fb",
"rank": 1,
"score": 100,
"summaryFriendData": {
"field": "value"
},
"tCode": "testTournament",
"tNotifiedAt": 0,
"tRank": 0,
"updatedAt": 1484937348565
}
]
}
}