Skip to main content

Leave Guild

Leaves a guild.

Check URL

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

API Information

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

Request Parameters

ParameterTypeRequiredDescription
device_idstringRequiredDevice ID
table_codestringRequiredTable code

Response Data

Leave Result

  • ErrorCode: Error code (empty string on success)
  • Message: Response message

Code Example

void UMyGame::WithdrawFromGuild(const FString& DeviceId, const FString& TableCode)
{
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("device_id"), DeviceId);
Body->SetStringField(TEXT("table_code"), TableCode);

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

// HTTP 요청
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetURL(TEXT("https://service-api.playnanoo.com/guild/v20230101/personal/withdraw"));
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))
{
FString Message = JsonObject->GetStringField(TEXT("Message"));
UE_LOG(LogTemp, Log, TEXT("길드 탈퇴 성공!"));
UE_LOG(LogTemp, Log, TEXT("Message: %s"), *Message);
}
}
});

Request->ProcessRequest();
}
Authentication Required

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

Leave Conditions
  • The guild master cannot leave. The master must first transfer their role to another member.
  • When leaving, the member's contribution points will be handled according to the guild setting (member_point_type).
Point Handling

Points are handled according to the member_point_type set during guild creation:

  • "keep": The leaving member's points remain in the guild
  • "delete": The leaving member's points are deducted from the guild's total
Important Notice

After leaving, you will lose access to all guild information and activity history. It is recommended to display a confirmation message to users before proceeding with the leave.