Overview
Executes the GetStatisticsLeaderboard operation on an inventory item.
Client
Require permission rules inventory.getStatisticsLeaderboard.selfEnable. See PermissionRules
POST /api/rJson/inventory/client/getStatisticsLeaderboard
| Name | Type | Required | Description |
|---|---|---|---|
| Auth-Token | string | true | A 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-Key | string | true | The SecretKey in SecretInfo with role must is Player. |
| Game-Id | string | Optional 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-Type | string | true | application/json |
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Key parameter. (2 - 32 characters) |
| infoRequestParam | InfoRequestParam | true | InfoRequestParam parameter. See InfoRequestParam |
| skip | number int | Skip parameter. (from 0) (Default: 0) | |
| limit | number int | Limit parameter. (from 1 to 100) (Default: 10) | |
| loadFromCache | boolean | LoadFromCache parameter. (Default: true) | |
| version | string | Version parameter. (2 - 32 characters) | |
| catalogId | string | Identifier of the item catalog used to create this item. (2 - 32 characters) |
Server
Require permission rules inventory.getStatisticsLeaderboard.serverSelfEnable. See PermissionRules
POST /api/rJson/inventory/server/getStatisticsLeaderboard
| Name | Type | Required | Description |
|---|---|---|---|
| Secret-Key | string | true | The SecretKey in SecretInfo with role must is Admin. |
| Game-Id | string | Optional 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-Type | string | true | application/json |
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Key parameter. (2 - 32 characters) |
| infoRequestParam | InfoRequestParam | true | InfoRequestParam parameter. See InfoRequestParam |
| skip | number int | Skip parameter. (from 0) (Default: 0) | |
| limit | number int | Limit parameter. (from 1 to 100) (Default: 10) | |
| loadFromCache | boolean | LoadFromCache parameter. (Default: true) | |
| version | string | Version parameter. (2 - 32 characters) | |
| catalogId | string | Identifier of the item catalog used to create this item. (2 - 32 characters) |
Admin
Require permission rules inventory.getStatisticsLeaderboard.adminSelfEnable. See PermissionRules
POST /api/rJson/inventory/admin/getStatisticsLeaderboard
| Name | Type | Required | Description |
|---|---|---|---|
| Secret-Key | string | true | The SecretKey in SecretInfo with role must is Admin. |
| Game-Id | string | Optional 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-Type | string | true | application/json |
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Key parameter. (2 - 32 characters) |
| infoRequestParam | InfoRequestParam | true | InfoRequestParam parameter. See InfoRequestParam |
| skip | number int | Skip parameter. (from 0) (Default: 0) | |
| limit | number int | Limit parameter. (from 1 to 100) (Default: 10) | |
| loadFromCache | boolean | LoadFromCache parameter. (Default: true) | |
| version | string | Version parameter. (2 - 32 characters) | |
| catalogId | string | Identifier of the item catalog used to create this item. (2 - 32 characters) |
200 Ok
| Code | Type | Required | Description |
|---|---|---|---|
| returnCode | ReturnCode | true | Additional metadata that can be attached to any request. Especially useful when working with advanced features such as EventCallbackScript. See ReturnCode |
| debugMessage | string | A 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. | |
| invalidRequestParameters | InvalidMember[] | 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 | |
| parameters | ResponseData | Just 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 |
| Name | Code | Description |
|---|---|---|
| SecretInvalid | -10 | The selected secret key is missing, wrong, or does not match the current route/game context. |
| MaxSizeRequestReject | -9 | The serialized request payload exceeded the maximum size accepted by the backend. |
| MaxRequestReject | -8 | The backend rejected the request because the current caller exceeded a request-rate limit. |
| MaxCCUReject | -7 | The backend rejected the request because the current concurrent-user/session limit was exceeded. |
| OperationNotAuthorized | -6 | The target operation exists, but the caller is not authorized for the selected role or target resource. |
| InvalidRequestParameters | -5 | The request shape or one or more request-member values are invalid. When available, inspect `invalidMembers` for field-level details. |
| OperationInvalid | -4 | The requested operation code is unknown or is not valid for the selected request type/role. |
| InternalServerError | -3 | The backend hit an unhandled internal failure before producing a valid business response. |
| OperationNotAllow | -2 | The 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 | -1 | The 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. |
| UnknownError | 0 | The request failed, but no more specific low-level return code was mapped. |
| Ok | 1 | The request completed successfully at protocol level and produced a response payload. Callers must still validate the business `errorCode` in that payload. |
| Code | Type | Required | Description |
|---|---|---|---|
| errorCode | ErrorCode | A 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 | |
| results | InventoryLeaderboardResponseData[] | true | Results field in GetStatisticsLeaderboardResponseData. See InventoryLeaderboardResponseData |
| tsCreate | number | Whether to include the timestamp of item creation. |
Flags for selecting which optional fields to include in the item response.
| Code | Type | Required | Description |
|---|---|---|---|
| catalogId | boolean | CatalogId field in InfoRequestParam. (Default: false) | |
| classId | boolean | ClassId field in InfoRequestParam. (Default: false) | |
| itemType | boolean | ItemType field in InfoRequestParam. (Default: false) | |
| amount | boolean | Amount field in InfoRequestParam. (Default: false) | |
| owner | boolean | Owner field in InfoRequestParam. (Default: false) | |
| removeStatus | boolean | RemoveStatus field in InfoRequestParam. (Default: false) | |
| segments | boolean | Whether to include item segment data in the response. (Default: false) | |
| customDatas | boolean | Whether to include custom data in the item response. (Default: false) | |
| displayName | boolean | Whether to include the item's display name. (Default: false) | |
| avatar | boolean | Whether to include the item’s avatar or image reference. (Default: false) | |
| tsCreate | boolean | Whether to include the timestamp of item creation. (Default: false) | |
| tags | boolean | Whether to include tags associated with the item. (Default: false) | |
| itemStatistics | boolean | List of statistics stored on the item. (Default: false) | |
| itemDatas | boolean | ItemDatas field in InfoRequestParam. (Default: false) | |
| itemDataKeys | string[] | ItemDataKeys field in InfoRequestParam. | |
| itemStatisticsKeys | string[] | ItemStatisticsKeys field in InfoRequestParam. | |
| customDataKeys | string[] | CustomDataKeys field in InfoRequestParam. | |
| tagKeys | string[] | TagKeys field in InfoRequestParam. |
Leaderboard entry including rank and value for an item.
| Code | Type | Required | Description |
|---|---|---|---|
| position | number | true | Position field in InventoryLeaderboardResponseData. |
| backupValue | number | BackupValue field in InventoryLeaderboardResponseData. | |
| itemId | string | true | ItemId field in InventoryLeaderboardResponseData. |
| infoResponseParameters | InfoResponseParameters | true | InfoResponseParameters field in InventoryLeaderboardResponseData. See InfoResponseParameters |
Contains optional fields included in item responses.
| Code | Type | Required | Description |
|---|---|---|---|
| catalogId | string | CatalogId field in InfoResponseParameters. | |
| classId | string | ClassId field in InfoResponseParameters. | |
| itemType | number | ItemType field in InfoResponseParameters. | |
| amount | number | Amount field in InfoResponseParameters. | |
| owner | GenericModels.OwnerItem | Owner field in InfoResponseParameters. See GenericModels.OwnerItem | |
| removeStatus | GenericModels.RemoveStatusItem | RemoveStatus field in InfoResponseParameters. See GenericModels.RemoveStatusItem | |
| segments | string[] | Whether to include item segment data in the response. | |
| customDatas | GenericModels.DataItem[] | Whether to include custom data in the item response. See GenericModels.DataItem | |
| displayName | string | Whether to include the item's display name. | |
| avatar | GenericModels.AvatarItem | Whether to include the item’s avatar or image reference. See GenericModels.AvatarItem | |
| tsCreate | number | Whether to include the timestamp of item creation. | |
| tags | GenericModels.TagItem[] | Whether to include tags associated with the item. See GenericModels.TagItem | |
| itemDatas | GenericModels.DataItem[] | ItemDatas field in InfoResponseParameters. See GenericModels.DataItem | |
| itemStatistics | GenericModels.StatisticsItem[] | List of statistics stored on the item. See GenericModels.StatisticsItem |
Represents the current owner of an entity such as an inventory item, character or group...
| Code | Type | Required | Description |
|---|---|---|---|
| type | number | true | Owner type. Map this value with the public `OwnerType` enum. |
| id | string | true | Owner id paired with `type`. |
Represents soft-remove metadata for an entity.
| Code | Type | Required | Description |
|---|---|---|---|
| tsRemove | number | true | Removal timestamp when the entity was soft-removed. |
| reason | string | Removal reason when the backend provides one. |
Represents an arbitrary key-value data entry.
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Data entry key used to identify the payload. |
| value | any | true | Raw value returned by the backend. This may be a primitive, `GNHashtable`, `GNArray`, or plain object-like data. |
Represents a generic avatar payload.
| Code | Type | Required | Description |
|---|---|---|---|
| type | number | true | Backend-defined avatar type identifier. The public SDK currently does not export a dedicated avatar enum. |
| value | string | true | Avatar value, typically a URL, file id, or provider-specific string. |
Represents a key-value tag entry.
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Tag key used to identify the metadata entry. |
| value | string | true | Tag value associated with `key`. |
Represents one statistics entry.
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Statistic key such as the configured metric name. |
| value | number | true | Numeric value of the statistic identified by `key`. |
| Name | Code | Description |
|---|---|---|
| Ok | 1 | The business operation completed successfully. |
| KeyNotFound | 9 | The requested key does not exist in the target data set. |
| VersionInvalid | 47 | The requested CloudScript version is invalid or unavailable. |
| Code | Type | Description |
|---|---|---|
| code | string | The parameterCode invalid. |
| invalidMemberType | InvalidMemberType | The invalid member type of this parameterCode. See InvalidMemberType |
| Name | Code | Description |
|---|---|---|
| UnknownError | 1 | The backend rejected the member but did not map it to a more specific validation category. |
| DataRequired | 2 | The member is required but missing. |
| TypeInvalid | 3 | The member type does not match the expected runtime type. |
| StringNull | 4 | A required string member is null or empty when null is not allowed. |
| StringMinLength | 5 | A string member is shorter than the configured minimum length. |
| StringMaxLength | 6 | A string member is longer than the configured maximum length. |
| NumberMinValue | 7 | A numeric member is lower than the configured minimum value. |
| NumberMaxValue | 8 | A numeric member is higher than the configured maximum value. |
| NumberMustInt | 9 | A numeric member must be an integer but received a non-integer value. |
| GNHashtableNull | 10 | A required `GNHashtable` member is null. |
| GNHashtableMinLength | 11 | A `GNHashtable` member contains fewer entries than allowed. |
| GNHashtableMaxLength | 12 | A `GNHashtable` member contains more entries than allowed. |
| GNArrayNull | 13 | A required `GNArray` member is null. |
| GNArrayMinLength | 14 | A `GNArray` member contains fewer items than allowed. |
| GNArrayMaxLength | 15 | A `GNArray` member contains more items than allowed. |