注销账户信息查询
通过注销密钥查询注销信息的 API。
URL 确认
此 API 使用 service-account.playnanoo.com 域名。
API 信息
- URL:
https://service-account.playnanoo.com/api/v20240101/withdrawal/search - Method:
PUT - 需要认证: 否
请求参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
| withdrawal_key | string | 必需 | 注销密钥 |
| platform | string | 必需 | 平台(例如:"aos"、"ios") |
| device_id | string | 必需 | 设备唯一 ID |
| device_model | string | 必需 | 设备型号 |
| device_os | string | 必需 | 设备 OS |
| device_language | string | 必需 | 设备语言(例如:"KO"、"EN") |
DeviceInfo 继承
此 API 的 Req 类继承自 DeviceInfo。DeviceInfo 的所有属性将自动包含。
响应数据
Res 类
| 字段 | 类型 | 说明 |
|---|---|---|
| Status | string | 注销状态 |
| Memo | string | 注销原因备注 |
| WithdrawalDate | string | 预计注销日期 |
Unity C# 实现
BaseResponse 类
所有 API 响应的基类。
public class BaseResponse
{
public string ErrorCode;
public string Message;
public string WithdrawalKey;
public string BlockKey;
}
字段说明:
ErrorCode:错误代码Message:错误信息WithdrawalKey:处于注销宽限期时恢复所需的密钥(仅在注销宽限期内的账户提供)BlockKey:被封禁账户时提供的密钥(仅在被封禁的账户提供)
注销信息查询类
using System;
using System.Collections;
using UnityEngine.Networking;
public class WithDrawalSearch
{
static string path = "https://service-account.playnanoo.com/api/v20240101/withdrawal/search";
[Serializable]
public class Req : DeviceInfo
{
public string withdrawal_key;
public IEnumerator Send(
string withdrawalKey,
Action<Res> onSuccess,
Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(withdrawalKey)) this.withdrawal_key = withdrawalKey;
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 Memo;
public string WithdrawalDate;
}
}
使用示例
public void SearchWithdrawalInfo(string withdrawalKey)
{
WithDrawalSearch.Req req = new WithDrawalSearch.Req();
StartCoroutine(req.Send(
withdrawalKey: withdrawalKey,
onSuccess: res =>
{
Debug.Log($"탈퇴 상태: {res.Status}");
Debug.Log($"탈퇴 사유: {res.Memo}");
Debug.Log($"탈퇴 예정일: {res.WithdrawalDate}");
// 날짜 파싱 예제
if (DateTime.TryParse(res.WithdrawalDate, out DateTime withdrawalDate))
{
TimeSpan remaining = withdrawalDate - DateTime.Now;
Debug.Log($"남은 기간: {remaining.Days}일 {remaining.Hours}시간");
}
},
onError: (error) =>
{
Debug.LogError($"탈퇴 정보 조회 실패: [{error.ErrorCode}] [{error.Message}]");
}
));
}
确认预计注销日期
通过 WithdrawalDate 字段可以确认账户被完全删除的日期。在此日期之前调用恢复 API 可以恢复账户。