道具数量 查询
查询邮箱中的物品数量。
URL确认
此API使用 service-api.playnanoo.com 域名。
API信息
- URL:
https://service-api.playnanoo.com/inbox/v20220901/count - Method:
PUT - 需要认证: 是
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| table_code | string | 必填 | 表 代码 |
响应数据
Res类
| 字段 | 类型 | 说明 |
|---|---|---|
| count | int | 邮箱 道具 数量 |
代码示例
void UMyGame::GetInboxCount(const FString& TableCode)
{
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
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/inbox/v20220901/count"));
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 Count = JsonObject->GetIntegerField(TEXT("count"));
UE_LOG(LogTemp, Log, TEXT("우편함 아이템 개수: %d"), Count);
}
}
});
Request->ProcessRequest();
}
表 代码
table_code是在PlayNANOO控制台中创建的邮箱表的代码。