Overview
Link the player's account to a account identifier.
Client
Require permission rules masterPlayer.linkAccount.selfEnable. See PermissionRules
POST /api/rJson/masterPlayer/client/linkAccount
| Name | Required | Description |
|---|---|---|
| Auth-Token | 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 | true | The SecretKey in SecretInfo with role must is Player. |
| Game-Id | 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 | true | application/json |
| Code | Type | Required | Description |
|---|---|---|---|
| userId | string | The unique identifier of the player. (10 characters) | |
| username | string | true | Username parameter. (6 - 32 characters) |
| password | string | true | Password associated with the email account. (6 - 64 characters) |
| forceLink | boolean | ForceLink parameter. (Default: false) |
Server
Require permission rules masterPlayer.linkAccount.serverSelfEnable. See PermissionRules
POST /api/rJson/masterPlayer/server/linkAccount
| Name | Required | Description |
|---|---|---|
| Secret-Key | true | The SecretKey in SecretInfo with role must is Server. |
| Game-Id | 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 | true | application/json |
| Code | Type | Required | Description |
|---|---|---|---|
| userId | string | true | The unique identifier of the player. (10 characters) |
| username | string | true | Username parameter. (6 - 32 characters) |
| password | string | true | Password associated with the email account. (6 - 64 characters) |
| forceLink | boolean | ForceLink parameter. (Default: false) |
Admin
Require permission rules masterPlayer.linkAccount.adminSelfEnable. See PermissionRules
POST /api/rJson/masterPlayer/admin/linkAccount
| Name | Required | Description |
|---|---|---|
| Secret-Key | true | The SecretKey in SecretInfo with role must is Admin. |
| Game-Id | 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 | true | application/json |
| Code | Type | Required | Description |
|---|---|---|---|
| userId | string | true | The unique identifier of the player. (10 characters) |
| username | string | true | Username parameter. (6 - 32 characters) |
| password | string | true | Password associated with the email account. (6 - 64 characters) |
| forceLink | boolean | ForceLink parameter. (Default: false) |
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 | Secret token is invalid (removed, expired or does not contains). |
| MaxSizeRequestReject | -9 | Request rejected due to exceeding maximum allowed size. |
| MaxRequestReject | -8 | Request rejected because the number of requests has exceeded the allowed limit per user or IP or exceeds the total number of pending requests the server is waiting to process.. |
| MaxCCUReject | -7 | Connection rejected due to exceeding the allowed CCU (Concurrent Users). |
| OperationNotAuthorized | -6 | You are not authorized to perform this operation. Possibly due to missing or invalid token, or insufficient permissions. |
| InvalidRequestParameters | -5 | Request parameters are invalid or missing. |
| OperationInvalid | -4 | The requested operation is invalid or not supported. |
| InternalServerError | -3 | Internal server error. Could be due to an unhandled exception or logic failure. |
| OperationNotAllow | -2 | This operation is not allowed in the current context. |
| OperationTimeout | -1 | The operation timed out. No response received within the expected time. |
| UnknownError | 0 | An unknown error occurred. The cause could not be determined. |
| Ok | 1 | Success. The operation completed successfully and returned a valid result. |
| 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 | |
| infoResponseParameters | InfoResponseParameters | true | InfoResponseParameters used in MasterPlayerResponseData. See InfoResponseParameters |
Parameter object used to control behavior or filters in API calls.
| Code | Type | Required | Description |
|---|---|---|---|
| external | ExternalItem | Indicates whether the player is external to the current environment. See ExternalItem | |
| segments | string[] | Timestamp when the event occurred. | |
| customDatas | GenericModels.DataItem[] | Custom key-value data defined by the game or system. See GenericModels.DataItem | |
| displayName | string | The public-facing name of the player. | |
| avatar | GenericModels.AvatarItem | URL or identifier of the player's avatar image. See GenericModels.AvatarItem | |
| tsCreate | number | Timestamp when the event occurred. | |
| tags | GenericModels.TagItem[] | Tag label used to group or filter the player. See GenericModels.TagItem | |
| playerBan | GenericModels.BanItem | Information about whether the player is currently banned. See GenericModels.BanItem | |
| playerDatas | GenericModels.DataItem[] | Key-value metadata stored in the player's profile. See GenericModels.DataItem | |
| playerCurrencies | GenericModels.CurrencyItem[] | List of all virtual currencies and their balances. See GenericModels.CurrencyItem | |
| playerStatistics | GenericModels.StatisticsItem[] | Name or value of the player's statistic. See GenericModels.StatisticsItem | |
| tsLastLogin | number | Timestamp when the event occurred. | |
| ipAddressCreate | string | IP address from which the player first registered. | |
| countryCode | string | Country associated with the player's IP or settings. | |
| string | The email address associated with the player's account. | ||
| pushNotifications | PushNotificationItem[] | PushNotifications used in InfoResponseParameters. See PushNotificationItem |
Represents a single unit of data related to the player.
| Code | Type | Required | Description |
|---|---|---|---|
| device | Device | Device used in ExternalItem. See Device | |
| account | Account | Account used in ExternalItem. See Account | |
| custom | Custom | Custom used in ExternalItem. See Custom | |
| apple | Apple | Apple used in ExternalItem. See Apple | |
| Google used in ExternalItem. See Google | |||
| Facebook used in ExternalItem. See Facebook | |||
| genericService | GenericService[] | GenericService used in ExternalItem. See GenericService | |
| googlePlayGameService | GooglePlayGameService | GooglePlayGameService used in ExternalItem. See GooglePlayGameService | |
| gameCenter | GameCenter | GameCenter used in ExternalItem. See GameCenter |
Data structure: Device.
| Code | Type | Required | Description |
|---|---|---|---|
| customDeviceId | string | CustomDeviceId used in Device. | |
| androidDeviceId | string | AndroidDeviceId used in Device. | |
| iOSDeviceId | string | iOSDeviceId used in Device. | |
| windowsPhoneDeviceId | string | WindowsPhoneDeviceId used in Device. | |
| windowsDeviceId | string | WindowsDeviceId used in Device. | |
| linuxDeviceId | string | LinuxDeviceId used in Device. | |
| macOSDeviceId | string | MacOSDeviceId used in Device. | |
| editorDeviceId | string | EditorDeviceId used in Device. |
Data structure: Account.
| Code | Type | Required | Description |
|---|---|---|---|
| username | string | Username used in Account. |
Data structure: Custom.
| Code | Type | Required | Description |
|---|---|---|---|
| customId | string | CustomId used in Custom. |
Data structure: Apple.
| Code | Type | Required | Description |
|---|---|---|---|
| appleId | string | true | AppleId used in Apple. |
| string | true | The email address associated with the player's account. |
Data structure: Google.
| Code | Type | Required | Description |
|---|---|---|---|
| googleId | string | true | GoogleId used in Google. |
| displayName | string | true | The public-facing name of the player. |
| string | true | The email address associated with the player's account. |
Data structure: Facebook.
| Code | Type | Required | Description |
|---|---|---|---|
| facebookId | string | true | FacebookId used in Facebook. |
| displayName | string | true | The public-facing name of the player. |
| string | true | The email address associated with the player's account. |
Data structure: GenericService.
| Code | Type | Required | Description |
|---|---|---|---|
| serviceName | string | true | ServiceName used in GenericService. |
| serviceId | string | true | ServiceId used in GenericService. |
Data structure: GooglePlayGameService.
| Code | Type | Required | Description |
|---|---|---|---|
| playerId | string | true | PlayerId used in GooglePlayGameService. |
| displayName | string | true | The public-facing name of the player. |
| string | true | The email address associated with the player's account. |
Data structure: GameCenter.
| Code | Type | Required | Description |
|---|---|---|---|
| playerId | string | true | PlayerId used in GameCenter. |
| displayName | string | true | The public-facing name of the player. |
| string | true | The email address associated with the player's account. |
Represents a structured key-value data pair stored in a player or group profile.
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Key used in a structured data pair. |
| value | any | true | Value assigned to the specified key. |
Represents avatar-related metadata such as image, icon, and background colors.
| Code | Type | Required | Description |
|---|---|---|---|
| type | number | true | Type field in AvatarItem. |
| value | string | true | Value assigned to the specified key. |
Represents a tag or category label used for filtering or grouping entities.
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Key used in a structured data pair. |
| value | string | true | Value assigned to the specified key. |
Details information about a ban applied to a player or entity.
| Code | Type | Required | Description |
|---|---|---|---|
| tsExpire | number | true | TsExpire field in BanItem. |
| reason | string | true | Text explaining why the ban or action was applied. |
Defines a virtual currency identifier and its current amount.
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Key used in a structured data pair. |
| value | number | true | Value assigned to the specified key. |
Represents a named statistic and its numeric value.
| Code | Type | Required | Description |
|---|---|---|---|
| key | string | true | Key used in a structured data pair. |
| value | number | true | Value assigned to the specified key. |
Represents a single unit of data related to the player.
| Code | Type | Required | Description |
|---|---|---|---|
| token | string | true | Token used in PushNotificationItem. |
| pushId | string | true | Identifier for the registered push notification device. |
| platformType | number | true | PlatformType used in PushNotificationItem. |
| Name | Code |
|---|---|
| Ok | 1 |
| MasterPlayerNotFound | 29 |
| ExternalLinkedOtherValue | 28 |
| ExternalLinkedOtherAccount | 27 |
| Code | Type | Description |
|---|---|---|
| code | string | The parameterCode invalid. |
| invalidMemberType | InvalidMemberType | The invalid member type of this parameterCode. See InvalidMemberType |
| Name | Code | Description |
|---|---|---|
| UnknownError | 1 | An unspecified or unexpected error has occurred. |
| DataRequired | 2 | A required data field is missing or not provided. |
| TypeInvalid | 3 | The data type provided does not match the expected type. |
| StringNull | 4 | A string value is null or has not been assigned. |
| StringMinLength | 5 | The string value is shorter than the minimum required length. |
| StringMaxLength | 6 | The string value exceeds the maximum allowed length. |
| NumberMinValue | 7 | The numeric value is less than the minimum allowed value. |
| NumberMaxValue | 8 | The numeric value exceeds the maximum allowed value. |
| NumberMustInt | 9 | The numeric value must be an integer but is not. |
| GNHashtableNull | 10 | The hashtable object is null or not provided. |
| GNHashtableMinLength | 11 | The hashtable contains fewer entries than the minimum required. |
| GNHashtableMaxLength | 12 | The hashtable contains more entries than the maximum allowed. |
| GNArrayNull | 13 | The array object is null or not provided. |
| GNArrayMinLength | 14 | The array contains fewer elements than the minimum required. |
| GNArrayMaxLength | 15 | The array contains more elements than the maximum allowed. |