跳转到主要内容

注销账户恢复

恢复处于注销宽限期内账户的 API。

URL 确认

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

API 信息

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

请求参数

参数类型必需说明
withdrawal_keystring必需注销密钥(注销请求时签发)
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 WithDrawalRestore
{
static string path = "https://service-account.playnanoo.com/api/v20240401/withdrawal/restore";

[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 void RestoreWithdrawal(string withdrawalKey)
{
WithDrawalRestore.Req req = new WithDrawalRestore.Req();

StartCoroutine(req.Send(
withdrawalKey: withdrawalKey,
onSuccess: res =>
{
Debug.Log($"계정 복구 완료: {res.Status}");
Debug.Log("이제 정상적으로 게임을 이용할 수 있습니다.");
},
onError: (error) =>
{
Debug.LogError($"계정 복구 실패: [{error.ErrorCode}] [{error.Message}]");

if (error.ErrorCode == "WITHDRAWAL_PERIOD_EXPIRED")
{
Debug.LogError("유예 기간이 만료되어 계정을 복구할 수 없습니다.");
}
}
));
}
获取 WithdrawalKey

withdrawal_key 可以在注销请求时或通过令牌状态检查 API 获取。只有在宽限期内才能恢复,宽限期过后将无法恢复账户。