Skip to main content

Record Contribution Points

Records a guild member's contribution points.

Check URL

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

API Information

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

Request Parameters

ParameterTypeRequiredDescription
device_idstringRequiredDevice ID
table_codestringRequiredTable code
pointnumberRequiredPoints to add (both positive and negative values allowed)
extra_datastringYesAdditional data (JSON string allowed)

Response Data

Point Information

  • TotalPoint: Updated total points
  • Point: Points added this time
  • ErrorCode: Error code (empty string on success)
  • Message: Response message

Code Example

void UMyGame::AddGuildPoint(const FString& DeviceId, const FString& TableCode, int32 Point, const FString& ExtraData)
{
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("device_id"), DeviceId);
Body->SetStringField(TEXT("table_code"), TableCode);
Body->SetNumberField(TEXT("point"), Point);
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/point"));
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))
{
int32 TotalPoint = JsonObject->GetIntegerField(TEXT("TotalPoint"));
int32 AddedPoint = JsonObject->GetIntegerField(TEXT("Point"));

UE_LOG(LogTemp, Log, TEXT("포인트 추가 성공!"));
UE_LOG(LogTemp, Log, TEXT("Added Point: %d"), AddedPoint);
UE_LOG(LogTemp, Log, TEXT("Total Point: %d"), TotalPoint);
}
}
});

Request->ProcessRequest();
}
Authentication Required

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

Point Values
  • Positive: Adds points (e.g., 100, 50)
  • Negative: Deducts points (e.g., -50, -100)
  • 0: Only queries current points (no change)
Point Range

There may be limits on point values. Be careful not to set excessively large values or to deduct so many points that the total becomes negative.

Using extra_data

You can record detailed information about point gains/deductions through the extra_data parameter:

  • Activity type (quest, raid, donation, etc.)
  • Reference ID (quest ID, event ID, etc.)
  • Additional metadata

Sending it as a JSON string makes log analysis easier later.