Skip to main content

Validation

This API checks the validity and status of an access token.

URL Confirmation

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

API Information​

  • URL: https://service-account.playnanoo.com/api/v20240401/token/status
  • Method: PUT
  • Authentication Required: No

Request Parameters​

ParameterTypeRequiredDescription
access_tokenstringRequiredAccess token to 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
StatusstringToken status
WithdrawalKeystringWithdrawal key (if withdrawal is pending)

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)

Token Status Check Class​

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

public class TokenStatus
{
static string path = "https://service-account.playnanoo.com/api/v20240401/token/status";

[Serializable]
public class Req : DeviceInfo
{
public string access_token;

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

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

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

Usage Example​

public void CheckTokenStatus(string accessToken)
{
TokenStatus.Req req = new TokenStatus.Req();

StartCoroutine(req.Send(
access_token: accessToken,
onSuccess: res =>
{
Debug.Log($"토큰 상태: {res.Status}");

if (!string.IsNullOrEmpty(res.WithdrawalKey))
{
Debug.Log($"탈퇴 대기 중 - WithdrawalKey: {res.WithdrawalKey}");
}
},
onError: (error) =>
{
Debug.LogError($"토큰 상태 확인 실패: [{error.ErrorCode}] [{error.Message}]");
}
));
}
Token Status Values

Possible values for the Status field:

  • "active": Token is valid and active
  • "expired": Token has expired
  • "withdrawal": Withdrawal pending