Skip to main content

Support players with failed rewards and streaks

Last updated on December 2, 2026

Overview​

Sometimes a player doesn't get a reward they earned, or loses a streak because of a problem outside their control. For example, a reward can fail to grant because its item no longer exists, or a lost login event can break a streak. AGS Challenge keeps every reward that failed to grant, with the GRANT_FAILED status, until it's granted again or closed.

This article explains how to use the AGS Game SDK on your game server, or in your own support tool, to:

  • Read a player's progress in a challenge.
  • List the rewards that failed to grant.
  • Grant failed rewards again, or close them without granting.
  • Fix a player's streak.

Prerequisites​

  • The AGS Game SDK installed and configured into your Unreal or Unity project, and your game server logged in.
  • AGS Game SDK for Unreal 28.13.0 or later (included in the AccelByte Online Subsystem plugin 0.13.19 or later), or AGS Game SDK for Unity 17.19.0 or later.
  • An AGS Identity and Access Management (IAM) client for your game server with these permissions:
    • ADMIN:NAMESPACE:{namespace}:CHALLENGE:PROGRESSION [READ, UPDATE]
    • ADMIN:NAMESPACE:{namespace}:CHALLENGE:REWARD [READ, UPDATE]

Read a player's progress​

To see a player's cycles, track, and remaining recoveries in a challenge, read their progress:

FAccelByteInstancePtr AccelByteInstancePtr = AccelByteOnlineSubsystemPtr->GetAccelByteInstance().Pin();
auto ServerApiClient = AccelByteInstancePtr->GetServerApiClient();
ServerApiClient->ServerChallenge.GetUserChallengeProgress(TEXT("userId"), TEXT("challengeCode")
, THandler<FAccelByteModelsChallengeProgressResponse>::CreateLambda([](const FAccelByteModelsChallengeProgressResponse& Response)
{
// Track is set for streak and cumulative challenges, Cycles for fixed calendar challenges with recovery
const FAccelByteModelsChallengeTrack& Track = Response.Track;
if (Track.Model != EAccelByteModelsChallengeModel::NONE)
{
UE_LOG(LogTemp, Log, TEXT("Run: %d Step: %d Streak: %d At risk: %s"),
Track.Run, Track.Step, Track.Streak, Track.StreakAtRisk ? TEXT("true") : TEXT("false"));
}
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("Failed to GetUserChallengeProgress [%d]: %s"), ErrorCode, *ErrorMessage);
}));

List failed rewards​

To find the rewards that failed to grant, list them. You can filter by player and by challenge:

FAccelByteInstancePtr AccelByteInstancePtr = AccelByteOnlineSubsystemPtr->GetAccelByteInstance().Pin();
auto ServerApiClient = AccelByteInstancePtr->GetServerApiClient();
ServerApiClient->ServerChallenge.GetFailedGrants(
THandler<FAccelByteModelsChallengeListFailedGrantsResponse>::CreateLambda([](const FAccelByteModelsChallengeListFailedGrantsResponse& Response)
{
for (const FAccelByteModelsChallengeFailedGrant& FailedGrant : Response.Data)
{
UE_LOG(LogTemp, Log, TEXT("Reward: %s Item: %s Reason: %s"), *FailedGrant.Id, *FailedGrant.ItemId, *FailedGrant.FailureReason);
}
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("Failed to GetFailedGrants [%d]: %s"), ErrorCode, *ErrorMessage);
})
, TEXT("userId")
, TEXT("challengeCode"));

Grant failed rewards again​

After you fix the cause, such as a missing item, grant the rewards again. If any of them fail again, the call fails with HTTP status 422, and the error lists the rewards that were granted and the ones that failed, the same as a partially granted claim.

A statistic reward whose earlier grant has an unknown outcome is refused with HTTP status 409, so it can't be granted twice. Check the player's statistic first, then set ConfirmAmbiguous to grant it anyway.

FAccelByteModelsChallengeRegrantRewardsRequest Request{};
Request.RewardIds = {TEXT("rewardId")};
// For a statistic reward refused with HTTP status 409, only after you checked the player's statistic:
// Request.ConfirmAmbiguous = true;

FAccelByteInstancePtr AccelByteInstancePtr = AccelByteOnlineSubsystemPtr->GetAccelByteInstance().Pin();
auto ServerApiClient = AccelByteInstancePtr->GetServerApiClient();
// Pass an FCustomErrorHandler to get the error body
ServerApiClient->ServerChallenge.RegrantUserRewards(TEXT("userId"), Request
, THandler<FAccelByteModelsChallengeRegrantRewardsResponse>::CreateLambda([](const FAccelByteModelsChallengeRegrantRewardsResponse& Response)
{
UE_LOG(LogTemp, Log, TEXT("RegrantUserRewards Success. Granted: %d"), Response.Granted.Num());
})
, FCustomErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage, const FJsonObject& ErrorObject)
{
FAccelByteModelsChallengePartialClaimError PartialGrant{};
if (FJsonObjectConverter::JsonObjectToUStruct(MakeShared<FJsonObject>(ErrorObject), &PartialGrant)
&& PartialGrant.Failed.Num() > 0)
{
for (const FAccelByteModelsChallengeFailedClaimReward& FailedReward : PartialGrant.Failed)
{
UE_LOG(LogTemp, Warning, TEXT("Not granted: %s Reason: %s"), *FailedReward.Id, *FailedReward.Reason);
}
return;
}

UE_LOG(LogTemp, Warning, TEXT("Failed to RegrantUserRewards [%d]: %s"), ErrorCode, *ErrorMessage);
}));

Close failed rewards without granting​

If a reward shouldn't be granted, for example because you compensated the player another way, close it with a reason. The reward gets the VOIDED status and is no longer owed.

FAccelByteModelsChallengeResolveFailedGrantsRequest Request{};
Request.RewardIds = {TEXT("rewardId")};
Request.Reason = TEXT("Compensated with a support grant");

FAccelByteInstancePtr AccelByteInstancePtr = AccelByteOnlineSubsystemPtr->GetAccelByteInstance().Pin();
auto ServerApiClient = AccelByteInstancePtr->GetServerApiClient();
ServerApiClient->ServerChallenge.ResolveUserFailedGrants(TEXT("userId"), Request
, THandler<FAccelByteModelsChallengeResolveFailedGrantsResponse>::CreateLambda([](const FAccelByteModelsChallengeResolveFailedGrantsResponse& Response)
{
for (const FAccelByteModelsChallengeResolveSkippedReward& NotResolved : Response.NotResolved)
{
UE_LOG(LogTemp, Warning, TEXT("Not closed: %s Reason: %s"), *NotResolved.Id, *NotResolved.Reason);
}
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("Failed to ResolveUserFailedGrants [%d]: %s"), ErrorCode, *ErrorMessage);
}));

Fix a player's streak​

If a streak broke because of a problem outside the player's control, such as a lost login event, set the player's streak back to the right step. Set GrantRewards to also grant the rewards of the steps the player gets back. This works on streak challenges only, and not on a run the player already completed.

FAccelByteModelsChallengeFixStreakRequest Request{};
Request.Step = 3;
Request.Reason = TEXT("Login event lost");
Request.GrantRewards = true;

FAccelByteInstancePtr AccelByteInstancePtr = AccelByteOnlineSubsystemPtr->GetAccelByteInstance().Pin();
auto ServerApiClient = AccelByteInstancePtr->GetServerApiClient();
ServerApiClient->ServerChallenge.FixUserStreak(TEXT("userId"), TEXT("challengeCode"), Request
, THandler<FAccelByteModelsChallengeFixStreakResponse>::CreateLambda([](const FAccelByteModelsChallengeFixStreakResponse& Response)
{
UE_LOG(LogTemp, Log, TEXT("FixUserStreak Success. Step: %d -> %d"), Response.Before.Step, Response.After.Step);
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("Failed to FixUserStreak [%d]: %s"), ErrorCode, *ErrorMessage);
}));