Skip to main content

Delete Friend

Deletes a registered friend.

URL Confirmation

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

API Information

  • URL: https://service-api.playnanoo.com/friend/v20231201/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
table_codestringRequiredFriend table code
relationship_codestringRequiredRelationship code of the friend to delete

Response Data

Res Class

FieldTypeDescription
StatusstringProcessing result 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)

Friend Delete Class

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

public class FriendDelete
{
static string path = "https://service-api.playnanoo.com/friend/v20231201/delete";

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

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

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

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
void DeleteFriend(string relationshipCode)
{
FriendDelete.Req req = new FriendDelete.Req();

StartCoroutine(req.Send(
tableCode: "friend_table",
relationshipCode: relationshipCode,
onSuccess: res =>
{
Debug.Log($"Friend deleted successfully: {res.Status}");
},
onError: (error) =>
{
Debug.LogError($"Failed to delete friend: [{error.ErrorCode}] [{error.Message}]");
}
));
}
}
Non-Recoverable

Friend deletion cannot be undone. It's recommended to get user confirmation before deletion.