Delete Player
API for deleting a specific player's record from the leaderboard.
URL Verification
This API uses the service-api.playnanoo.com domain.
API Information
- URL:
https://service-api.playnanoo.com/leaderboard/v20240301/delete - Method:
PUT - Authentication Required: Yes
DeviceInfo Inheritance
The Req class of this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| uid | string | Required | Table code |
| record_id | string | Required | Record ID to delete (player identifier) |
Response Data
Res Class
| Field | Type | Description |
|---|---|---|
| Status | string | Processing status |
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 if in withdrawal grace period (only provided for accounts in withdrawal grace period)BlockKey: Key provided if account is blocked (only provided for blocked accounts)
Delete Player Class
using System;
using System.Collections;
using UnityEngine.Networking;
public class PlayerDelete
{
static string path = "https://service-api.playnanoo.com/leaderboard/v20240301/delete";
[Serializable]
public class Req : DeviceInfo
{
public string uid;
public string record_id;
public IEnumerator Send(string table_code, string recordId, Action<Res> onSuccess, Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(table_code)) this.uid = table_code;
if (!string.IsNullOrEmpty(recordId)) this.record_id = recordId;
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;
}
}
Usage Example
public void DeletePlayerRecord()
{
PlayerDelete.Req req = new PlayerDelete.Req();
StartCoroutine(req.Send(
table_code: "my_leaderboard_table",
recordId: "player_001",
onSuccess: res =>
{
Debug.Log("Player record deleted successfully");
Debug.Log($"Status: {res.Status}");
},
onError: error =>
{
Debug.LogError($"Player record deletion failed: [{error.ErrorCode}] {error.Message}");
}
));
}
Deletion Caution
Deleted records cannot be recovered. It is recommended to implement a confirmation process before deletion.