GetPlayersSocialLeaderboard
Retrieve the social leaderboard for a list of players.
Service | Operation |
---|---|
leaderboard | GET_PLAYERS_SOCIAL_LEADERBOARD |
Method Parameters
Parameter | Description |
---|---|
leaderboardId | The ID of the leaderboard |
profileIds | The IDs of the players |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string leaderboardId = "default";
string[] profileIds = { "profile-id", "another-profile-id" };
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.LeaderboardService.GetPlayersSocialLeaderboard(leaderboardId, profileIds, successCallback, failureCallback);
const char *leaderboardId = "default";
std::vector<std::string> profileIds;
profileIds.push_back("profile-id");
profileIds.push_back("another-profile-id");
_bc->getLeaderboardService()->getPlayersSocialLeaderboard(leaderboardId, profileIds, this);
NSString *leaderboardId = @"default";
NSArray *profileIds = @[ @"profile-id", @"another-profile-id" ];
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc leaderboardService] getPlayersSocialLeaderboard:leaderboardId
profileIds:profileIds
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String leaderboardId = "default";
String[] profileIds = { "profile-id", "another-profile-id" };
this; // implements IServerCallback
_bc.getLeaderboardService().getPlayersSocialLeaderboard(leaderboardId, profileIds, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var leaderboardId = "default";
var profileIds = [ "profile-id", "another-profile-id" ];
_bc.leaderboard.getPlayersSocialLeaderboard(leaderboardId, profileIds, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var leaderboardId = "default";
var profileIds = [ "profile-id", "another-profile-id" ];
ServerResponse result = await _bc.leaderboardService.getPlayersSocialLeaderboard(leaderboardId:leaderboardId, profileIds:profileIds);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var leaderboardId = "default";
var profileIds = [ "profile-id", "another-profile-id" ];
var leaderboardProxy = bridge.getLeaderboardServiceProxy();
var postResult = leaderboardProxy.getPlayersSocialLeaderboard(leaderboardId, profileIds);
if (postResult.status == 200) {
// Success!
}
{
"service": "leaderboard",
"operation": "GET_PLAYERS_SOCIAL_LEADERBOARD",
"data": {
"leaderboardId": "default",
"profileIds": [
"profile-id",
"another-profile-id"
]
}
}
JSON Response
{
"status": 200,
"data": {
"leaderboardId": "general",
"timeBeforeReset": 3358262,
"leaderboard": [
{
"updatedAt": 1462825797845,
"pictureUrl": null,
"playerName": "Peter",
"playerId": "ee8cad26-16f2-4ef8-9045-3aab84ce6362",
"createdAt": 1462825797845,
"data": {
"nickname": "pete"
},
"score": 100,
"summaryFriendData": null
},
{
"updatedAt": 1462825730011,
"pictureUrl": null,
"playerName": "Billy",
"playerId": "295c510f-507f-4bcf-80e1-ebc73708ec3c",
"createdAt": 1462825730011,
"data": {
"nickname": "bill"
},
"score": 10,
"summaryFriendData": null
}
],
"server_time": 1462825845567
}
}