Skip to main content

Account Registration

This API creates a new account with email and password.

URL Confirmation

This API uses the service-account.playnanoo.com domain.

API Information

  • URL: https://service-account.playnanoo.com/api/v20240101/email/signup
  • Method: PUT
  • Authentication Required: No

Request Parameters

ParameterTypeRequiredDescription
linked_idstringRequiredEmail address
linked_passwordstringRequiredPassword
platformstringRequiredPlatform (e.g., "aos", "ios")
device_idstringRequiredDevice unique ID
device_modelstringRequiredDevice model name
device_osstringRequiredDevice OS
device_languagestringRequiredDevice language (e.g., "KO", "EN")
DeviceInfo Inheritance

The Req class for this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.

Response Data

Res Class

FieldTypeDescription
TokenSerializeTokenDataToken information
PlayerSerializePlayerDataPlayer information

SerializeTokenData Structure

FieldTypeDescription
AccessTokenstringAccess token
RefreshTokenstringRefresh token

SerializePlayerData Structure

FieldTypeDescription
UserUniqueIDstringUser unique ID
OpenIDstringOpen ID
NicknamestringNickname
LinkedIDstringLinked ID
LinkedTypestringLinked type
PurchaseCountintPurchase count
PurchaseCurrencyCodestringPurchase currency code
PurchaseTotalPricedoubleTotal purchase amount
PurchaseVoidedCountintRefund count
PurchaseVoidedCurrencyCodestringRefund currency code
PurchaseVoidedTotalPricedoubleTotal refund amount
CountrystringCountry
TimezonestringTimezone
OffsetintTime offset
JoinPeriodintJoin period

Unity C# Implementation

BaseResponse Class

Base class for all API responses.

public class BaseResponse
{
public string ErrorCode;
public string Message;
public string WithdrawalKey;
public string BlockKey;
}

Field descriptions:

  • ErrorCode: Error code
  • Message: Error message
  • WithdrawalKey: Key required for recovery when the account is in withdrawal grace period (only provided for accounts pending withdrawal)
  • BlockKey: Key provided when the account is blocked (only provided for blocked accounts)

Email Signup Class

using System;
using System.Collections;
using UnityEngine.Networking;

public class EmailSignup
{
static string path = "https://service-account.playnanoo.com/api/v20240101/email/signup";

[Serializable]
public class Req : DeviceInfo
{
public string linked_id;
public string linked_password;

public IEnumerator Send(
string linked_id,
string linked_password,
Action<Res> onSuccess,
Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(linked_id)) this.linked_id = linked_id;
if (!string.IsNullOrEmpty(linked_password)) this.linked_password = linked_password;

yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: false,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}

[Serializable]
public class Res : BaseResponse
{
public SerializeTokenData Token;
public SerializePlayerData Player;
}

[Serializable]
public class SerializeTokenData
{
public string AccessToken;
public string RefreshToken;
}

[Serializable]
public class SerializePlayerData
{
public string UserUniqueID;
public string OpenID;
public string Nickname;
public string LinkedID;
public string LinkedType;
public int PurchaseCount;
public string PurchaseCurrencyCode;
public double PurchaseTotalPrice;
public int PurchaseVoidedCount;
public string PurchaseVoidedCurrencyCode;
public double PurchaseVoidedTotalPrice;
public string Country;
public string Timezone;
public int Offset;
public int JoinPeriod;
}
}

Usage Example

public void EmailSignUp(string email, string password)
{
EmailSignup.Req req = new EmailSignup.Req();

StartCoroutine(req.Send(
linked_id: email,
linked_password: password,
onSuccess: res =>
{
// 회원가입 성공 - 자동으로 로그인됨
// 토큰
Debug.Log($"AccessToken: {res.Token.AccessToken}");
Debug.Log($"RefreshToken: {res.Token.RefreshToken}");

// 플레이어 정보
Debug.Log($"UserUniqueID: {res.Player.UserUniqueID}");
Debug.Log($"OpenID: {res.Player.OpenID}");
Debug.Log($"Nickname: {res.Player.Nickname}");
Debug.Log($"LinkedID: {res.Player.LinkedID}");
Debug.Log($"LinkedType: {res.Player.LinkedType}");
},
onError: (error) =>
{
Debug.LogError($"이메일 회원가입 실패: [{error.ErrorCode}] [{error.Message}]");

if (error.ErrorCode == "EMAIL_ALREADY_EXISTS")
{
Debug.LogError("이미 사용 중인 이메일입니다.");
}
}
));
}
Post-Signup Processing

Upon successful signup, the user is automatically logged in and issued access and refresh tokens. You can start the game immediately without a separate login process.