Skip to main content

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

ParameterTypeRequiredDescription
table_codestringRequiredTable code
namestringRequiredGuild 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

FieldTypeDescription
ItemsList\<SearchItemModel>Guild list

SearchItemModel Structure

FieldTypeDescription
TableCodestringTable code
UidstringGuild unique ID
NamestringGuild name
PointdoubleGuild points
MasterUuidstringMaster UUID
MasterNicknamestringMaster nickname
CountrystringCountry code
MemberCountintCurrent member count
MemberLimitintMember limit
AutoJoinstringAuto join status
ExtraDatastringExtra data
InDatestringGuild 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}");
}
));
}