Request to Join Guild
Requests to join a guild.
Check URL
This API uses the service-api.playnanoo.com domain.
API Information
- URL:
https://service-api.playnanoo.com/guild/v20230101/personal/request - 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 |
| uid | string | Required | Guild UID to join |
| extra_data | string | Yes | Additional data (join message, etc.) |
Response Data
On Success
ErrorCode: Empty string or nullMessage: Success message
Code Example
void UMyGame::RequestJoinGuild(const FString& DeviceId, const FString& TableCode, const FString& GuildUid, const FString& ExtraData)
{
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("device_id"), DeviceId);
Body->SetStringField(TEXT("table_code"), TableCode);
Body->SetStringField(TEXT("uid"), GuildUid);
if (!ExtraData.IsEmpty())
{
Body->SetStringField(TEXT("extra_data"), ExtraData);
}
// JSON 문자열 변환
FString JsonBody = FPlayNANOOHelper::ToJsonString(Body);
// HTTP 요청
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetURL(TEXT("https://service-api.playnanoo.com/guild/v20230101/personal/request"));
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.
Auto-Join
If the guild's auto_join setting is "Y", the join request will be automatically approved and you'll become a member immediately. If it's "N", approval from the guild master or administrators is required.
Join Restrictions
- You can only join one guild at a time.
- If you're already in a guild, you cannot apply to join other guilds.
- If you're blocked from the guild, you cannot apply to join.
Additional Data
extra_data can be used to send a join message or self-introduction. Guild masters can review this information when approving join requests.