Skip to main content

Registration and Management

This API sets or changes the player's nickname.

URL Confirmation

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

API Information​

  • URL: https://service-account.playnanoo.com/api/v20240401/nickname/put
  • Method: PUT
  • Authentication Required: Yes

Request Parameters​

ParameterTypeRequiredDescription
change_nicknamestringRequiredNickname to set
check_existsstringRequiredWhether to check for duplicates ("Y": check, "N": no check)
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
NicknamestringSet nickname

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 in withdrawal grace period)
  • BlockKey: Key provided when the account is blocked (only provided for blocked accounts)

Nickname Setting Class​

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

public class NicknamePut
{
static string path = "https://service-account.playnanoo.com/api/v20240401/nickname/put";

[Serializable]
public class Req : DeviceInfo
{
public string change_nickname;
public string check_exists;

public IEnumerator Send(
string change_nickname,
bool check_exists,
Action<Res> onSuccess,
Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(change_nickname)) this.change_nickname = change_nickname;
this.check_exists = check_exists ? "Y" : "N";

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

[Serializable]
public class Res : BaseResponse
{
public string Nickname;
}
}

Usage Example​

public void SetNickname(string newNickname)
{
NicknamePut.Req req = new NicknamePut.Req();

StartCoroutine(req.Send(
change_nickname: newNickname,
check_exists: true, // 중복 확인 수행
onSuccess: res =>
{
Debug.Log($"닉네임 설정 완료: {res.Nickname}");
},
onError: (error) =>
{
Debug.LogError($"닉네임 설정 실패: [{error.ErrorCode}] [{error.Message}]");

if (error.ErrorCode == "NICKNAME_ALREADY_EXISTS")
{
Debug.LogError("이미 사용 중인 닉네임입니다.");
}
}
));
}
check_exists Parameter
  • true (or "Y"): Performs nickname duplicate check. Returns an error if duplicate.
  • false (or "N"): Skips duplicate check and sets immediately.

It is generally recommended to set this to true to prevent duplicates.