Search Guild by Name
API to search for guilds by name.
URL Confirmation
This API uses the service-api.playnanoo.com domain.
API Information
- URL:
https://service-api.playnanoo.com/guild/v20230101/search/name - Method:
PUT - Authentication Required: Yes
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| table_code | string | Required | Table code |
| name | string | Required | Guild name to search |
DeviceInfo Inheritance
The Req class of this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.
Response Data
Res Class
| Field | Type | Description |
|---|---|---|
| Items | List\<SearchItemModel> | Guild list |
SearchItemModel Structure
| Field | Type | Description |
|---|---|---|
| TableCode | string | Table code |
| Uid | string | Guild unique ID |
| Name | string | Guild name |
| Point | double | Guild points |
| MasterUuid | string | Master UUID |
| MasterNickname | string | Master nickname |
| Country | string | Country code |
| MemberCount | int | Current member count |
| MemberLimit | int | Member limit |
| AutoJoin | string | Auto join status |
| ExtraData | string | Extra data |
| InDate | string | Guild creation date |
Unity C# Implementation
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class GuildSearchName
{
static string path = "https://service-api.playnanoo.com/guild/v20230101/search/name";
[Serializable]
public class Req : DeviceInfo
{
public string table_code;
public string name;
public IEnumerator Send(
string tableCode,
string name,
Action<Res> onSuccess,
Action<BaseResponse> onError
)
{
if (!string.IsNullOrEmpty(tableCode)) this.table_code = tableCode;
if (!string.IsNullOrEmpty(name)) this.name = name;
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public List<SearchItemModel> Items;
}
[Serializable]
public class SearchItemModel
{
public string TableCode;
public string Uid;
public string Name;
public double Point;
public string MasterUuid;
public string MasterNickname;
public string Country;
public int MemberCount;
public int MemberLimit;
public string AutoJoin;
public string ExtraData;
public string InDate;
}
}
Usage Example
public void SearchGuildByName()
{
GuildSearchName.Req req = new GuildSearchName.Req();
StartCoroutine(req.Send(
tableCode: "guild_table",
name: "MyGuild",
onSuccess: res =>
{
foreach (var item in res.Items)
{
Debug.Log($"Uid: {item.Uid}, Name: {item.Name}");
Debug.Log($"Point: {item.Point}, MemberCount: {item.MemberCount}/{item.MemberLimit}");
Debug.Log($"Master: {item.MasterNickname}");
}
},
onError: (error) =>
{
Debug.LogError($"Guild search failed: [{error.ErrorCode}] {error.Message}");
}
));
}