跳转到主要内容

注销申请

请求账户注销的 API。在注销宽限期内账户将被保留。

URL 确认

此 API 使用 service-account.playnanoo.com 域名。

API 信息

  • URL: https://service-account.playnanoo.com/api/v20240401/token/withdrawal
  • Method: PUT
  • 需要认证: 是

请求参数

参数类型必需说明
periodint必需注销宽限期(以天为单位)
account_tokenstring必需账户令牌
memostring必需注销原因备注
platformstring必需平台(例如:"aos"、"ios")
device_idstring必需设备唯一 ID
device_modelstring必需设备型号
device_osstring必需设备 OS
device_languagestring必需设备语言(例如:"KO"、"EN")
DeviceInfo 继承

此 API 的 Req 类继承自 DeviceInfo。DeviceInfo 的所有属性将自动包含。

响应数据

Res 类

字段类型说明
Statusstring状态值

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 WithDrawal
{
static string path = "https://service-account.playnanoo.com/api/v20240401/token/withdrawal";

[Serializable]
public class Req : DeviceInfo
{
public int period;
public string account_token;
public string memo;

public IEnumerator Send(
int period,
string account_token,
string memo,
Action<Res> onSuccess,
Action<BaseResponse> onError)
{
if (period > 0) this.period = period;
if (!string.IsNullOrEmpty(account_token)) this.account_token = account_token;
if (!string.IsNullOrEmpty(memo)) this.memo = memo;

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;
}
}

使用示例

public void RequestWithdrawal(string accessToken, string reason)
{
WithDrawal.Req req = new WithDrawal.Req();

StartCoroutine(req.Send(
period: 7, // 7일 유예 기간
account_token: accessToken,
memo: reason,
onSuccess: res =>
{
Debug.Log($"회원 탈퇴 요청 완료: {res.Status}");
Debug.Log("7일 후 계정이 완전히 삭제됩니다.");
},
onError: (error) =>
{
Debug.LogError($"회원 탈퇴 요청 실패: [{error.ErrorCode}] [{error.Message}]");
}
));
}
注销宽限期

请求注销后,账户将在指定的宽限期(period)内被保留。在宽限期内登录或调用恢复 API 可以取消注销。宽限期过后,账户和所有数据将被永久删除。