Skip to main content

Clear

API to delete items from the inbox.

URL Confirmation

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

API Information

  • URL: https://service-api.playnanoo.com/inbox/v20220901/clear
  • 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
table_codestringYesTable code

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 for blocked accounts (provided only for blocked accounts)

Inbox Item Delete Class

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

public class InboxClear
{
static string url = "https://service-api.playnanoo.com/inbox/v20220901/clear";

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

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

// PUT method call
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
url,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}

[Serializable]
public class Res : BaseResponse
{
public string status;
}
}

Usage Example

public void ClearInbox()
{
InboxClear.Req req = new InboxClear.Req();

StartCoroutine(req.Send(
tableCode: "inbox_table_01",
onSuccess: res =>
{
Debug.Log($"Inbox item deletion successful: {res.status}");
},
onError: (error) =>
{
Debug.LogError($"Inbox item deletion failed: [{error.ErrorCode}] [{error.Message}]");
}
));
}
Caution

This API deletes items from the inbox. Use with care.