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
| Parameter | Type | Required | Description |
|---|---|---|---|
| device_id | string | Required | Device ID |
| table_code | string | Required | Table code |
| sort_condition | string | Required | Sort condition ("random", "point", "in_date") |
| sort_type | string | Required | Sort type ("asc", "desc") |
| limit | number | Required | Number of guilds to retrieve |
| auto_join | string | Yes | Auto-join filter ("Y", "N") |
Response Data
Items Array
Each guild item includes the following information:
TableCode: Table codeUid: Guild unique IDName: Guild namePoint: Guild pointsMasterUuid: Master UUIDMasterNickname: Master nicknameCountry: Country codeMemberCount: Current member countMemberLimit: Maximum member countAutoJoin: Auto-join option ("Y" or "N")ExtraData: Additional dataInDate: 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