PostTournamentScoreOnBehalfOf
Post score to another user.
Service | Operation |
---|---|
tournament | POST_TOURNAMENT_SCORE_ON_BEHALF_OF |
Method Parameters
Parameter | Description |
---|---|
profileId | Profile id of the target user. |
leaderboardId | The leaderboard for the tournament. |
score | The score to post. |
data | Optional data attached to the leaderboard entry. |
roundStartedEpoch | Time the user started the match resulting in the score being posted. (Date is in millis.) |
forceCreate | Should a new score be created? When false, the call can only modify a currently existing score. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var profileId = "the-profile-id";
var leaderboardId = "leaderboardId";
var score = 0;
var data = {
"nickname": "batman"
};
var roundStartedEpoch = Date.now();
var forceCreate = false;
var tournamentProxy = bridge.getTournamentServiceProxy();
var postResult = tournamentProxy.postTournamentScoreOnBehalfOf(profileId, leaderboardId, score, data, roundStartedEpoch, forceCreate);
if (postResult.status == 200) {
// Success!
}
{
"service": "tournament",
"operation": "POST_TOURNAMENT_SCORE_ON_BEHALF_OF",
"data": {
"profileId": "the-profile-id",
"leaderboardId": "leaderboardId",
"score": 0,
"data": {
"nickname": "batman"
},
"roundStartedEpoch": "[[#ts]]",
"forceCreate": false
}
}
JSON Response
{
"data": {
"leaderboardId": "^D^div6^2",
"versionId": 1,
"playerId": "c5ecdbda-5f91-41a9-96aa-174f412f7657",
"score": 100,
"data": {
"nickname": "batman"
},
"createdAt": 1647877630346,
"updatedAt": 1647877788048,
"tCode": "tcode1",
"tRank": 0,
"tClaimedAt": 0,
"tNotifiedAt": 0,
"previousScore": 50
},
"status": 200
}