Query Player Block List
Explains how to query the list of blocked players.
URL Verification
This API uses the service-api.playnanoo.com domain.
API Information
- URL:
https://service-api.playnanoo.com/chat/v20211101/block - Method:
PUT - Authentication Required: Yes
Request Parameters
The Req class inherits from DeviceInfo.
No additional parameters required.
Response Data
Res
| Field | Type | Description |
|---|---|---|
| Items | List<BlockPlayerItem> | List of blocked players |
BlockPlayerItem
| Field | Type | Description |
|---|---|---|
| BlockUserId | string | Blocked user ID |
| BlockUserName | string | Blocked user name |
Unity C# Implementation
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Networking;
public class BlockPlayer
{
static string path = "https://service-api.playnanoo.com/chat/v20211101/block";
[Serializable]
public class Req : DeviceInfo
{
public IEnumerator Send(Action<Res> onSuccess, Action<BaseResponse> onError)
{
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public List<BlockPlayerItem> Items;
}
[Serializable]
public class BlockPlayerItem
{
public string BlockUserId;
public string BlockUserName;
}
}
Usage Example
using UnityEngine;
public class ChatExample : MonoBehaviour
{
public void BlockPlayerList()
{
BlockPlayer.Req req = new BlockPlayer.Req();
StartCoroutine(req.Send(
onSuccess: res =>
{
foreach(BlockPlayer.BlockPlayerItem item in res.Items)
{
Debug.Log($"BlockUserId : {item.BlockUserId}");
Debug.Log($"BlockUserName : {item.BlockUserName}");
}
},
onError: (error) =>
{
Debug.LogError($"BlockPlayerList failed: [{error.ErrorCode}] {error.Message}");
}
));
}
}