Skip to main content

Get Guild List

Retrieves the guild list.

Check URL

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

API Information

  • URL: https://service-api.playnanoo.com/guild/v20230101/search
  • Method: PUT
  • Authentication Required: Yes (Bearer Token)

Request Parameters

ParameterTypeRequiredDescription
device_idstringRequiredDevice ID
table_codestringRequiredTable code
sort_conditionstringRequiredSort condition ("random", "point", "in_date")
sort_typestringRequiredSort type ("asc", "desc")
limitnumberRequiredNumber of guilds to retrieve
auto_joinstringYesAuto-join filter ("Y", "N")

Response Data

Items Array

Each guild item includes the following information:

  • TableCode: Table code
  • Uid: Guild unique ID
  • Name: Guild name
  • Point: Guild points
  • MasterUuid: Master UUID
  • MasterNickname: Master nickname
  • Country: Country code
  • MemberCount: Current member count
  • MemberLimit: Maximum member count
  • AutoJoin: Auto-join option ("Y" or "N")
  • ExtraData: Additional data
  • InDate: Guild creation date and time

Code Example

void UMyGame::SearchGuilds(const FString& DeviceId, const FString& TableCode, const FString& SortCondition, const FString& SortType, int32 Limit, const FString& AutoJoin)
{
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("device_id"), DeviceId);
Body->SetStringField(TEXT("table_code"), TableCode);
Body->SetStringField(TEXT("sort_condition"), SortCondition);
Body->SetStringField(TEXT("sort_type"), SortType);
Body->SetNumberField(TEXT("limit"), Limit);
if (!AutoJoin.IsEmpty())
{
Body->SetStringField(TEXT("auto_join"), AutoJoin);
}

// JSON 문자열 변환
FString JsonBody = FPlayNANOOHelper::ToJsonString(Body);

// HTTP 요청
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetURL(TEXT("https://service-api.playnanoo.com/guild/v20230101/search"));
Request->SetVerb(TEXT("PUT"));
FPlayNANOOHelper::SetCommonHeaders(Request, true); // 인증 토큰 포함
Request->SetContentAsString(JsonBody);

Request->OnProcessRequestComplete().BindLambda(
[](FHttpRequestPtr Req, FHttpResponsePtr Res, bool bSuccess)
{
if (bSuccess && Res.IsValid())
{
TSharedPtr<FJsonObject> JsonObject;
TSharedRef<TJsonReader<>> Reader = TJsonReaderFactory<>::Create(Res->GetContentAsString());

if (FJsonSerializer::Deserialize(Reader, JsonObject))
{
const TArray<TSharedPtr<FJsonValue>>* ItemsArray;
if (JsonObject->TryGetArrayField(TEXT("Items"), ItemsArray))
{
UE_LOG(LogTemp, Log, TEXT("길드 조회 성공! 총 %d개"), ItemsArray->Num());

for (const auto& ItemValue : *ItemsArray)
{
TSharedPtr<FJsonObject> Item = ItemValue->AsObject();
FString Name = Item->GetStringField(TEXT("Name"));
FString Uid = Item->GetStringField(TEXT("Uid"));
int32 MemberCount = Item->GetIntegerField(TEXT("MemberCount"));
int32 MemberLimit = Item->GetIntegerField(TEXT("MemberLimit"));

UE_LOG(LogTemp, Log, TEXT("Guild: %s (%d/%d)"), *Name, MemberCount, MemberLimit);
}
}
}
}
});

Request->ProcessRequest();
}
Authentication Required

This API requires Bearer token authentication. You must first log in to obtain an access token.

Sort Conditions

The sort_condition parameter can use the following values:

  • "random": Random sorting
  • "point": Sort by points
  • "in_date": Sort by creation date
Sort Types

The sort_type parameter can use the following values:

  • "asc": Ascending order
  • "desc": Descending order
Auto-Join Filter

You can filter guilds using the auto_join parameter:

  • "Y": Retrieve only guilds with auto-join enabled
  • "N": Retrieve only guilds that require approval
  • Empty string or omit: Retrieve all guilds