Duplicate Check
This API checks if a nickname is already in use.
URL Confirmation
This API uses the service-account.playnanoo.com domain.
API Information
- URL:
https://service-account.playnanoo.com/api/v20240101/nickname/exists - Method:
PUT - Authentication Required: Yes
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| change_nickname | string | Required | Nickname to check |
| platform | string | Required | Platform (e.g., "aos", "ios") |
| device_id | string | Required | Device unique ID |
| device_model | string | Required | Device model name |
| device_os | string | Required | Device OS |
| device_language | string | Required | Device 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
| Field | Type | Description |
|---|---|---|
| Status | string | Status value |
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 codeMessage: Error messageWithdrawalKey: Key required for recovery when the account is in withdrawal grace period (only provided for accounts in withdrawal grace period)BlockKey: Key provided when the account is blocked (only provided for blocked accounts)
Nickname Duplicate Check Class
using System;
using System.Collections;
using UnityEngine.Networking;
public class NicknameExists
{
static string path = "https://service-account.playnanoo.com/api/v20240101/nickname/exists";
[Serializable]
public class Req : DeviceInfo
{
public string change_nickname;
public IEnumerator Send(
string change_nickname,
Action<Res> onSuccess,
Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(change_nickname)) this.change_nickname = change_nickname;
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public string Status;
}
}
Usage Example
public void CheckNicknameExists(string change_nickname)
{
NicknameExists.Req req = new NicknameExists.Req();
StartCoroutine(req.Send(
change_nickname: change_nickname,
onSuccess: res =>
{
if (res.Status == "Y")
{
Debug.Log("이미 사용 중인 닉네임입니다.");
}
else if (res.Status == "N")
{
Debug.Log("사용 가능한 닉네임입니다.");
}
},
onError: (error) =>
{
Debug.LogError($"닉네임 중복 확인 실패: [{error.ErrorCode}] [{error.Message}]");
}
));
}
Status Values
"Y": Nickname already exists (duplicate)"N": Nickname is available (not duplicate)