Overview

Retrieve leaderboard data based on statisticsleaderboardar.

Client

Require permission rules masterPlayer.getStatisticsLeaderboardAroundPlayer.selfEnable. See PermissionRules

HTTP

POST /api/rJson/masterPlayer/client/getStatisticsLeaderboardAroundPlayer

Request Headers
NameTypeRequiredDescription
Auth-TokenstringtrueA token used to authenticate the user. It is issued after successful login from the client type authenticate (e.g., loginByAccount, loginWithCustomId, etc.) or when an admin logs in via the GearN Dashboard. This token identifies the request sender and determines their access level.
Secret-KeystringtrueThe SecretKey in SecretInfo with role must is Player.
Game-IdstringOptional if the gameId in the SecretInfo use in headers Secret-Key has assign a valid value, if not, let unique identifier of the game this request is targeting.
Content-Typestringtrueapplication/json
Request Body
CodeTypeRequiredDescription
userIdstringThe unique identifier of the player. (10 characters)
keystringtrueThe key associated with a custom player data entry. (2 - 32 characters)
infoRequestParamInfoRequestParamtrueFlags and filters used to control the information included in the response. See InfoRequestParam
skipnumber intSkip parameter. (from 0) (Default: 0)
limitnumber intLimit parameter. (from 1 to 100) (Default: 10)
loadFromCachebooleanLoadFromCache parameter. (Default: true)
Server

Require permission rules masterPlayer.getStatisticsLeaderboardAroundPlayer.serverSelfEnable. See PermissionRules

HTTP

POST /api/rJson/masterPlayer/server/getStatisticsLeaderboardAroundPlayer

Request Headers
NameTypeRequiredDescription
Secret-KeystringtrueThe SecretKey in SecretInfo with role must is Server.
Game-IdstringOptional if the gameId in the SecretInfo use in headers Secret-Key has assign a valid value, if not, let unique identifier of the game this request is targeting.
Content-Typestringtrueapplication/json
Request Body
CodeTypeRequiredDescription
userIdstringtrueThe unique identifier of the player. (10 characters)
keystringtrueThe key associated with a custom player data entry. (2 - 32 characters)
infoRequestParamInfoRequestParamtrueFlags and filters used to control the information included in the response. See InfoRequestParam
skipnumber intSkip parameter. (from 0) (Default: 0)
limitnumber intLimit parameter. (from 1 to 100) (Default: 10)
loadFromCachebooleanLoadFromCache parameter. (Default: true)
Admin

Require permission rules masterPlayer.getStatisticsLeaderboardAroundPlayer.adminSelfEnable. See PermissionRules

HTTP

POST /api/rJson/masterPlayer/admin/getStatisticsLeaderboardAroundPlayer

Request Headers
NameTypeRequiredDescription
Secret-KeystringtrueThe SecretKey in SecretInfo with role must is Admin.
Game-IdstringOptional if the gameId in the SecretInfo use in headers Secret-Key has assign a valid value, if not, let unique identifier of the game this request is targeting.
Content-Typestringtrueapplication/json
Request Body
CodeTypeRequiredDescription
userIdstringtrueThe unique identifier of the player. (10 characters)
keystringtrueThe key associated with a custom player data entry. (2 - 32 characters)
infoRequestParamInfoRequestParamtrueFlags and filters used to control the information included in the response. See InfoRequestParam
skipnumber intSkip parameter. (from 0) (Default: 0)
limitnumber intLimit parameter. (from 1 to 100) (Default: 10)
loadFromCachebooleanLoadFromCache parameter. (Default: true)
Response Body

200 Ok

CodeTypeRequiredDescription
returnCodeReturnCodetrueAdditional metadata that can be attached to any request. Especially useful when working with advanced features such as EventCallbackScript. See ReturnCode
debugMessagestringA developer-oriented message that provides additional context useful for debugging and internal logging. This field is not intended for end-users and may include stack traces, validation failures, or internal error diagnostics.
invalidRequestParametersInvalidMember[]Just had data when the returnCode is InvalidRequestParameters.A list of members that failed validation or could not be processed during the request. Each entry typically includes identifying information and an error reason. This is useful for partial success scenarios where some members are accepted and others are rejected. See InvalidMember
parametersResponseDataJust had data when the returnCode is Ok. A dynamic set of key-value pairs included in the response to provide additional context or metadata. These parameters may vary depending on the operation and typically contain optional fields such as timestamps, identifiers, or computed values relevant to the result. See ResponseData
ReturnCode
NameCodeDescription
SecretInvalid-10The selected secret key is missing, wrong, or does not match the current route/game context.
MaxSizeRequestReject-9The serialized request payload exceeded the maximum size accepted by the backend.
MaxRequestReject-8The backend rejected the request because the current caller exceeded a request-rate limit.
MaxCCUReject-7The backend rejected the request because the current concurrent-user/session limit was exceeded.
OperationNotAuthorized-6The target operation exists, but the caller is not authorized for the selected role or target resource.
InvalidRequestParameters-5The request shape or one or more request-member values are invalid.
When available, inspect `invalidMembers` for field-level details.
OperationInvalid-4The requested operation code is unknown or is not valid for the selected request type/role.
InternalServerError-3The backend hit an unhandled internal failure before producing a valid business response.
OperationNotAllow-2The operation is known and the secret key is valid, but the permission rules attached
to the current secret key do not allow this operation in the current target context.
This usually maps to missing `selfEnable`, `otherSelfEnable`, `serverSelfEnable`,
or `adminSelfEnable` permission for the resolved request.
OperationTimeout-1The request timed out before a response was received.
This code may be synthesized by the SDK timeout layer as well as returned by the backend.
UnknownError0The request failed, but no more specific low-level return code was mapped.
Ok1The request completed successfully at protocol level and produced a response payload.
Callers must still validate the business `errorCode` in that payload.
ResponseData
CodeTypeRequiredDescription
errorCodeErrorCodeA string that represents the status of the operation. It indicates whether the request was successful or failed due to a specific error condition. See ErrorCode
resultsMasterPlayerLeaderboardResponseData[]trueTimestamp when the event occurred. See MasterPlayerLeaderboardResponseData
tsCreatenumberTimestamp when the event occurred.
InfoRequestParam

Parameter object used to control behavior or filters in API calls.

CodeTypeRequiredDescription
externalbooleanIndicates whether the player is external to the current environment. (Default: false)
segmentsbooleanTimestamp when the event occurred. (Default: false)
customDatasbooleanCustom key-value data defined by the game or system. (Default: false)
displayNamebooleanThe public-facing name of the player. (Default: false)
avatarbooleanURL or identifier of the player's avatar image. (Default: false)
tsCreatebooleanTimestamp when the event occurred. (Default: false)
tagsbooleanTag label used to group or filter the player. (Default: false)
playerBanbooleanInformation about whether the player is currently banned. (Default: false)
playerCurrenciesbooleanList of all virtual currencies and their balances. (Default: false)
playerStatisticsbooleanName or value of the player's statistic. (Default: false)
playerDatasbooleanKey-value metadata stored in the player's profile. (Default: false)
ipAddressCreatebooleanIP address from which the player first registered. (Default: false)
countryCodebooleanCountry associated with the player's IP or settings. (Default: false)
emailbooleanThe email address associated with the player's account. (Default: false)
tsLastLoginbooleanTimestamp when the event occurred. (Default: false)
pushNotificationsbooleanPushNotifications used in InfoRequestParam. (Default: false)
playerDataKeysstring[]The key name in a key-value data pair.
playerCurrencyKeysstring[]The key name in a key-value data pair.
playerStatisticsKeysstring[]The key name in a key-value data pair.
customDataKeysstring[]The key name in a key-value data pair.
tagKeysstring[]The key name in a key-value data pair.
MasterPlayerLeaderboardResponseData

Structured data returned by the corresponding API operation.

CodeTypeRequiredDescription
positionnumbertruePosition used in MasterPlayerLeaderboardResponseData.
backupValuenumberThe value assigned to a data key or statistic.
userIdstringtrueUnique identifier of the player.
infoResponseParametersInfoResponseParameterstrueInfoResponseParameters used in MasterPlayerLeaderboardResponseData. See InfoResponseParameters
InfoResponseParameters

Parameter object used to control behavior or filters in API calls.

CodeTypeRequiredDescription
externalExternalItemIndicates whether the player is external to the current environment. See ExternalItem
segmentsstring[]Timestamp when the event occurred.
customDatasGenericModels.DataItem[]Custom key-value data defined by the game or system. See GenericModels.DataItem
displayNamestringThe public-facing name of the player.
avatarGenericModels.AvatarItemURL or identifier of the player's avatar image. See GenericModels.AvatarItem
tsCreatenumberTimestamp when the event occurred.
tagsGenericModels.TagItem[]Tag label used to group or filter the player. See GenericModels.TagItem
playerBanGenericModels.BanItemInformation about whether the player is currently banned. See GenericModels.BanItem
playerDatasGenericModels.DataItem[]Key-value metadata stored in the player's profile. See GenericModels.DataItem
playerCurrenciesGenericModels.CurrencyItem[]List of all virtual currencies and their balances. See GenericModels.CurrencyItem
playerStatisticsGenericModels.StatisticsItem[]Name or value of the player's statistic. See GenericModels.StatisticsItem
tsLastLoginnumberTimestamp when the event occurred.
ipAddressCreatestringIP address from which the player first registered.
countryCodestringCountry associated with the player's IP or settings.
emailstringThe email address associated with the player's account.
pushNotificationsPushNotificationItem[]PushNotifications used in InfoResponseParameters. See PushNotificationItem
ExternalItem

Represents a single unit of data related to the player.

CodeTypeRequiredDescription
deviceDeviceDevice used in ExternalItem. See Device
accountAccountAccount used in ExternalItem. See Account
customCustomCustom used in ExternalItem. See Custom
appleAppleApple used in ExternalItem. See Apple
googleGoogleGoogle used in ExternalItem. See Google
facebookFacebookFacebook used in ExternalItem. See Facebook
genericServiceGenericService[]GenericService used in ExternalItem. See GenericService
googlePlayGameServiceGooglePlayGameServiceGooglePlayGameService used in ExternalItem. See GooglePlayGameService
gameCenterGameCenterGameCenter used in ExternalItem. See GameCenter
Device

Data structure: Device.

CodeTypeRequiredDescription
customDeviceIdstringCustomDeviceId used in Device.
androidDeviceIdstringAndroidDeviceId used in Device.
iOSDeviceIdstringiOSDeviceId used in Device.
windowsPhoneDeviceIdstringWindowsPhoneDeviceId used in Device.
windowsDeviceIdstringWindowsDeviceId used in Device.
linuxDeviceIdstringLinuxDeviceId used in Device.
macOSDeviceIdstringMacOSDeviceId used in Device.
editorDeviceIdstringEditorDeviceId used in Device.
Account

Data structure: Account.

CodeTypeRequiredDescription
usernamestringUsername used in Account.
Custom

Data structure: Custom.

CodeTypeRequiredDescription
customIdstringCustomId used in Custom.
Apple

Data structure: Apple.

CodeTypeRequiredDescription
appleIdstringtrueAppleId used in Apple.
emailstringtrueThe email address associated with the player's account.
Google

Data structure: Google.

CodeTypeRequiredDescription
googleIdstringtrueGoogleId used in Google.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
Facebook

Data structure: Facebook.

CodeTypeRequiredDescription
facebookIdstringtrueFacebookId used in Facebook.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
GenericService

Data structure: GenericService.

CodeTypeRequiredDescription
serviceNamestringtrueServiceName used in GenericService.
serviceIdstringtrueServiceId used in GenericService.
GooglePlayGameService

Data structure: GooglePlayGameService.

CodeTypeRequiredDescription
playerIdstringtruePlayerId used in GooglePlayGameService.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
GameCenter

Data structure: GameCenter.

CodeTypeRequiredDescription
playerIdstringtruePlayerId used in GameCenter.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
Generic.DataItem

Represents an arbitrary key-value data entry.

CodeTypeRequiredDescription
keystringtrueData entry key used to identify the payload.
valueanytrueRaw value returned by the backend. This may be a primitive, `GNHashtable`, `GNArray`, or plain object-like data.
Generic.AvatarItem

Represents a generic avatar payload.

CodeTypeRequiredDescription
typenumbertrueBackend-defined avatar type identifier. The public SDK currently does not export a dedicated avatar enum.
valuestringtrueAvatar value, typically a URL, file id, or provider-specific string.
Generic.TagItem

Represents a key-value tag entry.

CodeTypeRequiredDescription
keystringtrueTag key used to identify the metadata entry.
valuestringtrueTag value associated with `key`.
Generic.BanItem

Represents a ban state entry returned by player-auth or player-profile flows.

CodeTypeRequiredDescription
tsExpirenumbertrueExpiration timestamp of the current ban state. -1 is never unban.
reasonstringtrueHuman-readable ban reason when provided by the backend.
Generic.CurrencyItem

Represents one currency entry.

CodeTypeRequiredDescription
keystringtrueCurrency key such as the configured currency code or logical name.
valuenumbertrueNumeric balance of the currency identified by `key`.
Generic.StatisticsItem

Represents one statistics entry.

CodeTypeRequiredDescription
keystringtrueStatistic key such as the configured metric name.
valuenumbertrueNumeric value of the statistic identified by `key`.
PushNotificationItem

Represents a single unit of data related to the player.

CodeTypeRequiredDescription
tokenstringtrueToken used in PushNotificationItem.
pushIdstringtrueIdentifier for the registered push notification device.
platformTypenumbertruePlatformType used in PushNotificationItem.
ErrorCode
NameCodeDescription
Ok1The business operation completed successfully.
KeyNotFound9The requested key does not exist in the target data set.
InvalidMember
CodeTypeDescription
codestringThe parameterCode invalid.
invalidMemberTypeInvalidMemberTypeThe invalid member type of this parameterCode. See InvalidMemberType
InvalidMemberType
NameCodeDescription
UnknownError1The backend rejected the member but did not map it to a more specific validation category.
DataRequired2The member is required but missing.
TypeInvalid3The member type does not match the expected runtime type.
StringNull4A required string member is null or empty when null is not allowed.
StringMinLength5A string member is shorter than the configured minimum length.
StringMaxLength6A string member is longer than the configured maximum length.
NumberMinValue7A numeric member is lower than the configured minimum value.
NumberMaxValue8A numeric member is higher than the configured maximum value.
NumberMustInt9A numeric member must be an integer but received a non-integer value.
GNHashtableNull10A required `GNHashtable` member is null.
GNHashtableMinLength11A `GNHashtable` member contains fewer entries than allowed.
GNHashtableMaxLength12A `GNHashtable` member contains more entries than allowed.
GNArrayNull13A required `GNArray` member is null.
GNArrayMinLength14A `GNArray` member contains fewer items than allowed.
GNArrayMaxLength15A `GNArray` member contains more items than allowed.