탈퇴 계정 정보 조회
탈퇴 키로 탈퇴 정보를 조회하는 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를 호출하면 계정을 복구할 수 있습니다.