Skip to main content

Delete Data

API for deleting saved game data.

URL Verification

This API uses the service-storage-api.playnanoo.com domain.

API Information

  • URL: https://service-storage-api.playnanoo.com/storage/v20230801/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

ParameterTypeRequiredDescription
storage_keystringRequiredKey of the data to delete

Response Data

Res Class

FieldTypeDescription
StatusstringProcessing 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 code
  • Message: Error message
  • WithdrawalKey: Key required for recovery if account is in withdrawal grace period (provided only for accounts in withdrawal grace period)
  • BlockKey: Key provided if account is blocked (provided only for blocked accounts)

Delete Data Class

using System;
using System.Collections;
using UnityEngine.Networking;

public class StorageDelete
{
static string path = "https://service-storage-api.playnanoo.com/storage/v20230801/delete";

[Serializable]
public class Req : DeviceInfo
{
public string storage_key;

public IEnumerator Send(string storage_key, Action<Res> onSuccess, Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(storage_key)) this.storage_key = storage_key;

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 DeleteGameData()
{
StorageDelete.Req req = new StorageDelete.Req();

StartCoroutine(req.Send(
storage_key: "old_game_data",
onSuccess: res =>
{
Debug.Log("Data deletion successful");
Debug.Log($"Status: {res.Status}");
},
onError: error =>
{
Debug.LogError($"Data deletion failed: [{error.ErrorCode}] {error.Message}");
}
));
}
Non-recoverable

Deleted data cannot be recovered. It is recommended to ask the user for confirmation before deleting important data.

Selective Deletion

Only data with the specified key is deleted. To delete multiple data items, you must call the API individually for each key.