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
| Parameter | Type | Required | Description |
|---|---|---|---|
| access_token | string | Required | Access token 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 | Token status |
| WithdrawalKey | string | Withdrawal 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 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)
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