Store restricted player and game data in admin records
Overview
This article walks you through how to:
- Access admin records in the AccelByte Gaming Services (AGS) Admin Portal.
- Create, modify, retrieve, and delete admin records.
Prerequisites
You will need access to:
- The AGS Admin Portal
- The AGS Cloud Save API documentation
Manage admin records in the Admin Portal
Access the Admin Records page
On the Admin Portal sidebar, go to Progression & Inventory > Cloud Save > Admin Records.
On the Admin Records page, depending on the record type you want to view, open the Game Records or the Player Records tab.
Create a new admin record
To create a new admin record to store player or game data, follow these steps:
On the Admin Portal sidebar, go to Progression & Inventory > Cloud Save > Admin Records.
On the Admin Records page, depending on the record type, open the Game Records or the Player Records tab. Then, click on the + Add record button.
- Admin Game Records: The data will not be associated with a specific user ID and can be used to store game-wide data but only an admin and a game server can access it.
- Admin Player Records: The data will be associated with a specific user ID and can be used to store specific user data but only the admin and a game server can access it.
On the Add Record form, fill in the required information:
Game Records
Key: add the Game Record key. This is the identifier of the record.
JSON Configuration: add the data you want to store in JSON format.
Player Records
User ID: add the user ID of the user that will be associated with the record.
Key: add the Player Record key. This is the identifier of the record.
JSON Configuration: add the data you want to store in JSON format.
Click Add to create the record. The new record will be added to the list.
Modify admin records
The AGS Admin Portal allows you to modify admin records if you want to take manual action with the data, such as fixing data, auditing, etc.
To modify an admin record, follow these steps:
On the Admin Portal sidebar, go to Progression & Inventory > Cloud Save > Admin Records.
On the Admin Records page, depending on the record type, open the Game Records or the Player Records tab.
For game records, find the record you want to modify from the list or use the search option to search for records using the game record key. Click on the record's View button under the Action menu to open its details page.
For player records, search for the record using the player's email or username. Click on the record's View button under the Action menu to open its details page.
On the details page of the record, click on the pencil or edit icon of the fields or sections to update the content.
Save your changes.
Delete admin records
The AGS Admin Portal allows you to delete admin records if you want to delete records as necessary.
To delete an admin record, follow these steps:
On the Admin Portal sidebar, go to Progression & Inventory > Cloud Save > Admin Records.
On the Admin Records page, depending on the record type, open the Game Records or the Player Records tab.
For game records, find the record you want to modify from the list or use the search option to search for records using the game record key. Click on the record's Delete button under the Action menu. A confirmation message appears.
For player records, search for the record using the player's email or username. Click on the record's Delete button under the Action menu. A confirmation message appears.
Click Delete on the confirmation message. The record is immediately deleted from the records list.
Manage admin records with the Server SDK
With the Server SDK, you can:
- Create new admin records to store player or game data
- Retrieve admin records
- Modify admin records
- Delete admin records
Create new admin records to store player or game data via Game Server
You can create admin records that are dynamically created after some actions are triggered from the Game Server. This function can be used to store additional match information, which is restricted for the player and can be used by the Game Server for the next match.
You can create a new record and store the data through the following methods:
Create admin game records
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
FJsonObject DataJson;
const FString gameId = FGuid::NewGuid().ToString();
DataJson.SetStringField("gameId", gameId);
DataJson.SetStringField("region", TEXT("ID"));
DataJson.SetStringField("language", TEXT("en"));
ServerApiClient->ServerCloudSave.SaveGameRecord(Key
, DataJson
, FVoidHandler::CreateLambda([]()
{
// Do something if SaveGameRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if SaveGameRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string key = "SomeCloudSaveKey";
string gameId = Guid.NewGuid().ToString();
Dictionary<string, object> dataJson = new Dictionary<string, object>
{
{"gameId", gameId }, {"region", "ID" }, {"language", "en" }
};
RecordSetBy setBy = RecordSetBy.SERVER;
serverCloudSave.SaveGameRecord(key, dataJson, setBy, result =>
{
if (result.IsError)
{
// Do something if SaveGameRecord has an error
Debug.Log($"Error SaveGameRecord, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if SaveGameRecord is successful
});
adminGameRecordService := &cloudsave.AdminGameRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key := "someKey"
body := map[string]interface{}{
"gameId": "5a7aab0c7e2147c4be9693083748634f",
"region": "US",
"language": "en",
}
namespace := "mygame"
input := &admin_game_record.AdminPostGameRecordHandlerV1Params{
Body: body,
Key: key,
Namespace: namespace,
}
result, err := adminGameRecordService.AdminPostGameRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_post_game_record_handler_v1(
body=cloudsave_models.ModelsGameRecordRequest.create(
{
"gameId": "****",
"region": "ID",
"language": "en",
"__META": {
"set_by": "SERVER"
}
}
),
key="SomeCloudSaveKey",
)
if error:
exit(error)
@Builder
public class MyGameRecord extends ModelsGameRecordRequest {
@JsonProperty("gameId")
public String gameId;
@JsonProperty("region")
public String region;
@JsonProperty("language")
public String language;
}
...
final AdminGameRecord adminGameRecordWrapper = new AdminGameRecord(sdk);
String key = "graphicQuality";
String userId = "<user-id>";
var record = MyGameRecord.builder()
.gameId(UUID.randomUUID().toString().replace("-", ""))
.language("en")
.region("US")
.build();
ModelsGameRecordAdminResponse response;
try {
response = adminGameRecordWrapper.adminPostGameRecordHandlerV1(AdminPostGameRecordHandlerV1.builder()
.namespace("<namespace>")
.key(key)
.body(record)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with response when success
}
public class MyGameRecord : ModelsGameRecordRequest
{
[JsonPropertyName("gameId")]
public string GameId { get; set; } = "";
[JsonPropertyName("region")]
public string Region { get; set; } = "";
[JsonPropertyName("language")]
public string Language { get; set; } = "";
}
string key = "someKey";
var record = new MyGameRecord()
{
GameId = Guid.NewGuid().ToString().Replace("-", ""),
Language = "en",
Region = "US"
};
var response = sdk.Cloudsave.AdminGameRecord.AdminPostGameRecordHandlerV1Op
.Execute(record, key, sdk.Namespace);
if (response != null)
{
//do something with response when success
}
Create a temporary admin game records
- Unreal Engine
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
FJsonObject DataJson;
const FString gameId = FGuid::NewGuid().ToString();
DataJson.SetStringField("gameId", gameId);
DataJson.SetStringField("region", TEXT("ID"));
DataJson.SetStringField("language", TEXT("en"));
FTTLConfig TTLConfig{};
TTLConfig.Action = EAccelByteTTLConfigAction::DELETE_RECORD;
TTLConfig.Expires_At = FDateTime::UtcNow() + FTimespan(0, 0, 5); // Will delete this record in the next five seconds
ServerApiClient->ServerCloudSave.SaveGameRecord(Key
, DataJson
, FVoidHandler::CreateLambda([]()
{
// Do something if SaveGameRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if SaveGameRecord has an error
})
, TTLConfig);
adminGameRecordService := &cloudsave.AdminGameRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key := "someKey"
body := map[string]interface{}{
"gameId": "5a7aab0c7e2147c4be9693083748634f",
"region": "US",
"language": "en",
"__META": map[string]interface{}{
"ttl_config": map[string]interface{}{
"action":"DELETE",
"expires_at":"2025-12-31T08:00:00",
},
},
}
namespace := "mygame"
input := &admin_game_record.AdminPostGameRecordHandlerV1Params{
Body: body,
Key: key,
Namespace: namespace,
}
result, err := adminGameRecordService.AdminPostGameRecordHandlerV1Short(input)
from datetime import datetime, timedelta
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_post_game_record_handler_v1(
body=cloudsave_models.ModelsGameRecordRequest.create(
{
"gameId": "****",
"region": "ID",
"language": "en",
"__META": {
"set_by": "SERVER",
"ttl_config": {
"action": "DELETE",
"expires_at": (datetime.now() + timedelta(seconds=5)).isoformat(),
}
}
}
),
key="SomeCloudSaveKey",
)
if error:
exit(error)
@Builder
public class MyGameRecordWithMeta extends ModelsGameRecordRequest {
@Builder
public class TTLConfig {
@JsonProperty("action")
public String action;
@JsonProperty("expires_at")
public String expiresAt;
}
@Builder
public class Meta
{
@JsonProperty("set_by")
public String setBy;
@JsonProperty("is_public")
public boolean isPublic;
@JsonProperty("ttl_config")
public TTLConfig ttlConfig;
}
@JsonProperty("__META")
public Meta RecordMeta;
@JsonProperty("lastLocation")
public String lastLocation;
@JsonProperty("gameId")
public String gameId;
@JsonProperty("region")
public String region;
@JsonProperty("language")
public String language;
}
...
final AdminGameRecord adminGameRecordWrapper = new AdminGameRecord(sdk);
String key = "someKey";
var record = MyGameRecordWithMeta.builder()
.RecordMeta(MyGameRecordWithMeta.Meta.builder()
.setBy("SERVER")
.ttlConfig(MyGameRecordWithMeta.Meta.builder().ttlConfig.builder()
.action("DELETE")
.expiresAt(Instant.now().plusSeconds(5*60).atOffset(ZoneOffset.UTC).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)) //expires in 5 minutes
.build())
.build())
.gameId(UUID.randomUUID().toString().replace("-",""))
.language("en")
.region("US")
.build();
ModelsGameRecordAdminResponse response;
try {
response = adminGameRecordWrapper.adminPostGameRecordHandlerV1(AdminPostGameRecordHandlerV1.builder()
.namespace("<namespace>")
.key(key)
.body(record)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with response when success
}
public class MyGameRecordWithMeta : ModelsGameRecordRequest
{
public class TTLConfig
{
[JsonPropertyName("action")]
public string Action { get; set; } = "";
[JsonPropertyName("expires_at")]
public string ExpiresAt { get; set; } = "";//ISO8601 date format
}
public class Meta
{
[JsonPropertyName("set_by")]
public string SetBy { get; set; } = "";
[JsonPropertyName("is_public")]
public bool IsPublic { get; set; } = false;
[JsonPropertyName("ttl_config")]
public TTLConfig TTL { get; set; } = new TTLConfig();
}
[JsonPropertyName("__META")]
public Meta RecordMeta { get; set; } = new Meta();
[JsonPropertyName("gameId")]
public string GameId { get; set; } = "";
[JsonPropertyName("region")]
public string Region { get; set; } = "";
[JsonPropertyName("language")]
public string Language { get; set; } = "";
}
string key = "someKey";
var record = new MyGameRecordWithMeta()
{
RecordMeta = new MyGameRecordWithMeta.Meta()
{
SetBy = "SERVER",
TTL = new MyGameRecordWithMeta.TTLConfig()
{
Action = "DELETE",
ExpiresAt = DateTime.Now.AddMinutes(5).ToString("O",CultureInfo.InvariantCulture) //expires in 5 minutes
}
},
GameId = Guid.NewGuid().ToString().Replace("-", ""),
Language = "en",
Region = "US"
};
var response = sdk.Cloudsave.AdminGameRecord.AdminPostGameRecordHandlerV1Op
.Execute(record, key, sdk.Namespace);
if (response != null)
{
//do something with response when success
}
Create admin player records
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString UserId = "SomeUserId";
FString Key = "SomeCloudSaveKey";
FJsonObject DataJson;
const FString gameId = FGuid::NewGuid().ToString();
DataJson.SetStringField("gameId", gameId);
DataJson.SetStringField("region", TEXT("ID"));
DataJson.SetStringField("language", TEXT("en"));
ServerApiClient->ServerCloudSave.SaveUserRecord(UserId
, Key
, DataJson
, FVoidHandler::CreateLambda([]()
{
// Do something if SaveUserRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if SaveUserRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string userId = "SomeUserId";
string key = "SomeCloudSaveKey";
string gameId = Guid.NewGuid().ToString();
Dictionary<string, object> dataJson = new Dictionary<string, object>
{
{"gameId", gameId }, {"region", "ID" }, {"language", "en" }
};
serverCloudSave.SaveUserRecord(userId, key, dataJson, result =>
{
if (result.IsError)
{
// Do something if SaveUserRecord has an error
Debug.Log($"Error SaveUserRecord, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if SaveUserRecord is successful
});
adminPlayerRecordService := &cloudsave.AdminPlayerRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key := "someKey"
body := map[string]interface{}{
"__META": map[string]interface{}{
"set_by":"SERVER",
},
"lastLocation":"x:2330,y:8710",
}
namespace := "mygame"
userId := "myuserid"
input := &admin_player_record.AdminPostPlayerRecordHandlerV1Params{
Body: body,
Key: key,
Namespace: namespace,
UserID: userId,
}
result, err := adminPlayerRecordService.AdminPostPlayerRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_post_player_record_handler_v1(
body=cloudsave_models.ModelsPlayerRecordRequest.create(
{
"gameId": "****",
"region": "ID",
"language": "en",
"__META": {
"set_by": "SERVER"
}
}
),
key="SomeCloudSaveKey",
user_id="********************************",
)
if error:
exit(error)
final AdminPlayerRecord adminPlayerRecordWrapper = new AdminPlayerRecord(sdk);
String key = "characterLocation";
String userId = "<user-id>";
var record = MyCharacterLocation.builder()
.RecordMeta(MyCharacterLocation.Meta.builder()
.setBy("SERVER")
.build())
.lastLocation("x:2330,y:8710")
.build();
ModelsPlayerRecordResponse response;
try {
response = adminPlayerRecordWrapper.adminPostPlayerRecordHandlerV1(AdminPostPlayerRecordHandlerV1.builder()
.namespace("<namespace>")
.userId(userId)
.key(key)
.body(record)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with response when success
}
string key = "someKey";
string userId = "<user-id>";
var record = new MyCharacterLocation()
{
RecordMeta = new MyCharacterLocation.Meta()
{
SetBy = "SERVER"
},
LastLocation = "x:2330,y:8710"
};
var response = sdk.Cloudsave.AdminPlayerRecord.AdminPostPlayerRecordHandlerV1Op
.Execute(record, key, sdk.Namespace, userId);
if (response != null)
{
//do something with response when success
}
Retrieve admin records from Game Server
You can retrieve admin records from the Game server through the following methods:
- Retrieve a specific admin game record by key.
- Retrieve a specific admin player record for a specific user ID by key.
Retrieve a specific admin game record by key
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
ServerApiClient->ServerCloudSave.GetGameRecord(Key
, THandler<FAccelByteModelsGameRecord>::CreateLambda([](const FAccelByteModelsGameRecord& Response)
{
// Do something if GetGameRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetGameRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string key = "SomeCloudSaveKey";
serverCloudSave.GetGameRecords(key, result =>
{
if (result.IsError)
{
// Do something if GetGameRecords has an error
Debug.Log($"Error GetGameRecords, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
// Do something if GetGameRecords is successful
});
adminGameRecordService := &cloudsave.AdminGameRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key := "someKey"
namespace := "mygame"
input := &admin_game_record.AdminGetGameRecordHandlerV1Params{
Key: key,
Namespace: namespace,
}
result, err := adminGameRecordService.AdminGetGameRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_get_game_record_handler_v1(
key="SomeCloudSaveKey",
)
if error:
exit(error)
final AdminGameRecord adminGameRecordWrapper = new AdminGameRecord(sdk);
String key = "someKey";
ModelsGameRecordAdminResponse response;
try {
response = adminGameRecordWrapper.adminGetGameRecordHandlerV1(AdminGetGameRecordHandlerV1.builder()
.namespace("<namespace>")
.key(key)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with the data
}
string key = "someKey";
var response = sdk.Cloudsave.AdminGameRecord.AdminGetGameRecordHandlerV1Op
.Execute(key, sdk.Namespace);
if (response != null)
{
//do something with the data
}
Retrieve a specific admin player record for a specific user ID key
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
FString UserId = "SomeUserId";
ServerApiClient->ServerCloudSave.GetUserRecord(Key
, UserId
, THandler<FAccelByteModelsUserRecord>::CreateLambda([](const FAccelByteModelsUserRecord& Response)
{
// Do something if GetUserRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetUserRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string userId = "SomeUserId";
string key = "SomeCloudSaveKey";
serverCloudSave.GetUserRecord(userId, key, result =>
{
if (result.IsError)
{
// Do something if GetUserRecord has an error
Debug.Log($"Error GetUserRecord, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetUserRecord is successful
});
adminPlayerRecordService := &cloudsave.AdminPlayerRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key := "someKey"
namespace := "mygame"
userId := "myuserid"
input := &admin_player_record.AdminGetPlayerRecordHandlerV1Params{
Key: key,
Namespace: namespace,
UserID: userId,
}
result, err := adminPlayerRecordService.AdminGetPlayerRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_get_player_record_handler_v1(
key="SomeCloudSaveKey",
user_id="********************************",
)
if error:
exit(error)
final AdminPlayerRecord adminPlayerRecordWrapper = new AdminPlayerRecord(sdk);
String key = "someKey";
String userId = "<user-id>";
ModelsPlayerRecordResponse response;
try {
response = adminPlayerRecordWrapper.adminGetPlayerRecordHandlerV1(AdminGetPlayerRecordHandlerV1.builder()
.namespace("<namespace>")
.userId(userId)
.key(key)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with the data
}
string key = "someKey";
string userId = "<user-id>";
var response = sdk.Cloudsave.AdminPlayerRecord.AdminGetPlayerRecordHandlerV1Op
.Execute(key, sdk.Namespace, userId);
if (response != null)
{
//do something with the data
}
Modify admin records from the Game Server
To modify or update data within admin records from the Game Server, follow these steps:
Modify admin game records
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
FJsonObject DataJson;
const FString gameId = FGuid::NewGuid().ToString();
DataJson.SetStringField("gameId", gameId);
DataJson.SetStringField("region", TEXT("ES"));
DataJson.SetStringField("language", TEXT("es"));
ServerApiClient->ServerCloudSave.ReplaceGameRecord(Key
, DataJson
, FVoidHandler::CreateLambda([]()
{
// Do something if ReplaceGameRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if ReplaceGameRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string key = "SomeCloudSaveKey";
string gameId = Guid.NewGuid().ToString();
Dictionary<string, object> dataJson = new Dictionary<string, object>
{
{"gameId", gameId }, {"region", "ES" }, {"language", "es" }
};
RecordSetBy setBy = RecordSetBy.SERVER;
serverCloudSave.ReplaceGameRecord(key, dataJson, setBy, result =>
{
if (result.IsError)
{
// Do something if ReplaceGameRecord has an error
Debug.Log($"Error ReplaceGameRecord, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if ReplaceGameRecord is successful
});
adminGameRecordService := &cloudsave.AdminGameRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key, _ := cmd.Flags().GetString("key")
body := map[string]interface{}{
"gameId": "5a7aab0c7e2147c4be9693083748634f",
"region": "US",
"language": "en",
}
namespace := "mygame"
input := &admin_game_record.AdminPutGameRecordHandlerV1Params{
Body: body,
Key: key,
Namespace: namespace,
}
result, err := adminGameRecordService.AdminPutGameRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_put_game_record_handler_v1(
body=cloudsave_models.ModelsGameRecordRequest.create(
{
"gameId": "****",
"region": "ES",
"language": "es",
"__META": {
"set_by": "SERVER"
}
}
),
key="SomeCloudSaveKey",
)
if error:
exit(error)
final AdminGameRecord adminGameRecordWrapper = new AdminGameRecord(sdk);
String key = "someKey";
var record = MyGameRecord.builder()
.gameId(UUID.randomUUID().toString().replace("-", ""))
.language("en")
.region("US")
.build();
ModelsGameRecordAdminResponse response;
try {
response = adminGameRecordWrapper.adminPutGameRecordHandlerV1(AdminPutGameRecordHandlerV1.builder()
.namespace("<namespace>")
.key(key)
.body(record)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with response when success
}
string key = "someKey";
var record = new MyGameRecord()
{
GameId = Guid.NewGuid().ToString().Replace("-", ""),
Language = "en",
Region = "US"
};
var response = sdk.Cloudsave.AdminGameRecord.AdminPutGameRecordHandlerV1Op
.Execute(record, key, sdk.Namespace);
if (response != null)
{
//do something with response when success
}
Modify admin game records to become temporary
- Unreal Engine
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
FJsonObject DataJson;
const FString gameId = FGuid::NewGuid().ToString();
DataJson.SetStringField("gameId", gameId);
DataJson.SetStringField("region", TEXT("ES"));
DataJson.SetStringField("language", TEXT("es"));
FTTLConfig TTLConfig{};
TTLConfig.Action = EAccelByteTTLConfigAction::DELETE_RECORD;
TTLConfig.Expires_At = FDateTime::UtcNow() + FTimespan(0, 0, 5); // Will delete this record in the next five seconds
ServerApiClient->ServerCloudSave.ReplaceGameRecord(Key
, DataJson
, FVoidHandler::CreateLambda([]()
{
// Do something if ReplaceGameRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if ReplaceGameRecord has an error
})
, TTLConfig);
adminGameRecordService := &cloudsave.AdminGameRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key, _ := cmd.Flags().GetString("key")
body := map[string]interface{}{
"gameId": "5a7aab0c7e2147c4be9693083748634f",
"region": "US",
"language": "en",
"__META": map[string]interface{}{
"ttl_config": map[string]interface{}{
"action":"DELETE",
"expires_at":"2025-12-31T08:00:00",
},
},
}
namespace := "mygame"
input := &admin_game_record.AdminPutGameRecordHandlerV1Params{
Body: body,
Key: key,
Namespace: namespace,
}
result, err := adminGameRecordService.AdminPutGameRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_put_game_record_handler_v1(
body=cloudsave_models.ModelsGameRecordRequest.create(
{
"gameId": "****",
"region": "ES",
"language": "es",
"__META": {
"set_by": "SERVER"
}
}
),
key="SomeCloudSaveKey",
)
if error:
exit(error)
final AdminGameRecord adminGameRecordWrapper = new AdminGameRecord(sdk);
String key = "someKey";
var record = MyGameRecordWithMeta.builder()
.RecordMeta(MyGameRecordWithMeta.Meta.builder()
.setBy("SERVER")
.ttlConfig(MyGameRecordWithMeta.Meta.builder().ttlConfig.builder()
.action("DELETE")
.expiresAt(Instant.now().plusSeconds(5*60).atOffset(ZoneOffset.UTC).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)) //expires in 5 minutes
.build())
.build())
.gameId(UUID.randomUUID().toString().replace("-",""))
.language("en")
.region("US")
.build();
ModelsGameRecordAdminResponse response;
try {
response = adminGameRecordWrapper.adminPutGameRecordHandlerV1(AdminPutGameRecordHandlerV1.builder()
.namespace("<namespace>")
.key(key)
.body(record)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with response when success
}
string key = "someKey";
var record = new MyGameRecordWithMeta()
{
RecordMeta = new MyGameRecordWithMeta.Meta()
{
SetBy = "SERVER",
TTL = new MyGameRecordWithMeta.TTLConfig()
{
Action = "DELETE",
ExpiresAt = DateTime.Now.AddMinutes(5).ToString("O", CultureInfo.InvariantCulture) //expires in 5 minutes
}
},
GameId = Guid.NewGuid().ToString().Replace("-", ""),
Language = "en",
Region = "US"
};
var response = sdk.Cloudsave.AdminGameRecord.AdminPutGameRecordHandlerV1Op
.Execute(record, key, sdk.Namespace);
if (response != null)
{
//do something with response when success
}
Modify admin player records
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
FString UserId = "SomeUserId";
FJsonObject DataJson;
const FString gameId = FGuid::NewGuid().ToString();
DataJson.SetStringField("gameId", gameId);
DataJson.SetStringField("region", TEXT("ES"));
DataJson.SetStringField("language", TEXT("es"));
ServerApiClient->ServerCloudSave.ReplaceUserRecord(Key
, UserId
, DataJson
, FVoidHandler::CreateLambda([]()
{
// Do something if ReplaceUserRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if ReplaceUserRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string userId = "SomeUserId";
string key = "SomeCloudSaveKey";
string gameId = Guid.NewGuid().ToString();
Dictionary<string, object> dataJson = new Dictionary<string, object>
{
{"gameId", gameId }, {"region", "ES" }, {"language", "es" }
};
serverCloudSave.ReplaceUserRecord(userId, key, dataJson, result =>
{
if (result.IsError)
{
// Do something if ReplaceUserRecord has an error
Debug.Log($"Error ReplaceUserRecord, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if ReplaceUserRecord is successful
});
adminPlayerRecordService := &cloudsave.AdminPlayerRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key := "someKey"
body := map[string]interface{}{
"textures": 2,
"shadow": 2,
"lighting": 2,
"post-precessing": 2,
}
namespace := "mygame"
userId := "myuserid"
input := &admin_player_record.AdminPutPlayerRecordHandlerV1Params{
Body: body,
Key: key,
Namespace: namespace,
UserID: userId,
}
result, err := adminPlayerRecordService.AdminPutPlayerRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_put_player_record_handler_v1(
body=cloudsave_models.ModelsPlayerRecordRequest.create(
{
"gameId": "****",
"region": "ES",
"language": "es",
"__META": {
"set_by": "SERVER",
}
}
),
key="SomeCloudSaveKey",
user_id="********************************",
)
if error:
exit(error)
final AdminPlayerRecord adminPlayerRecordWrapper = new AdminPlayerRecord(sdk);
String key = "graphicQuality";
String userId = "<user-id>";
var record = MyGraphicQuality.builder()
.textures(2)
.shadow(2)
.lighting(2)
.postProcessing(2)
.build();
ModelsPlayerRecordResponse response;
try {
response = adminPlayerRecordWrapper.adminPutPlayerRecordHandlerV1(AdminPutPlayerRecordHandlerV1.builder()
.namespace("<namespace>")
.userId(userId)
.key(key)
.body(record)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something with response when success
}
string key = "someKey";
string userId = "<user-id>";
var record = new MyGraphicQuality()
{
Textures = 2,
Shadow = 2,
Lighting = 2,
PostProcessing = 2
};
var response = sdk.Cloudsave.AdminPlayerRecord.AdminPutPlayerRecordHandlerV1Op
.Execute(record, key, sdk.Namespace, userId);
if (response != null)
{
//do something with response when success
}
Delete admin records from game server
To delete admin records from the Game Server, follow these steps:
Delete Admin Game Records
- Unreal Engine
- Unity
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
ServerApiClient->ServerCloudSave.DeleteGameRecord(Key
, FVoidHandler::CreateLambda([]()
{
// Do something if DeleteGameRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if DeleteGameRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string key = "SomeCloudSaveKey";
serverCloudSave.DeleteGameRecord(key, result =>
{
if (result.IsError)
{
// Do something if DeleteGameRecord has an error
Debug.Log($"Error DeleteGameRecord, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if DeleteGameRecord is successful
});
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_delete_game_record_handler_v1(
key="SomeCloudSaveKey",
)
if error:
exit(error)
final AdminGameRecord adminGameRecordWrapper = new AdminGameRecord(sdk);
String key = "someKey";
try {
adminGameRecordWrapper.adminDeleteGameRecordHandlerV1(AdminDeleteGameRecordHandlerV1.builder()
.namespace("<namespace>")
.key(key)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
string key = "someKey";
sdk.Cloudsave.AdminGameRecord.AdminDeleteGameRecordHandlerV1Op
.Execute(key, sdk.Namespace);
Delete admin player records
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FServerApiClientPtr ServerApiClient = FMultiRegistry::GetServerApiClient();
FString Key = "SomeCloudSaveKey";
FString UserId = "SomeUserId";
bool bIsPublic = true;
ServerApiClient->ServerCloudSave.DeleteUserRecord(Key
, UserId
, bIsPublic
, FVoidHandler::CreateLambda([]()
{
// Do something if DeleteUserRecord is successful
})
, FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if DeleteUserRecord has an error
}));
ServerCloudSave serverCloudSave = AccelByteSDK.GetServerRegistry().GetApi().GetCloudSave();
string userId = "SomeUserId";
string key = "SomeCloudSaveKey";
serverCloudSave.DeleteUserRecord(userId, key, result =>
{
if (result.IsError)
{
// Do something if DeleteUserRecord has an error
Debug.Log($"Error DeleteUserRecord, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if DeleteUserRecord is successful
});
adminPlayerRecordService := &cloudsave.AdminPlayerRecordService{
Client: factory.NewCloudsaveClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
key := "characterLocation"
namespace := "mygame"
userId := "myuserid"
input := &admin_player_record.AdminDeletePlayerRecordHandlerV1Params{
Key: key,
Namespace: namespace,
UserID: userId,
}
err := adminPlayerRecordService.AdminDeletePlayerRecordHandlerV1Short(input)
import accelbyte_py_sdk.api.cloudsave as cloudsave_service
import accelbyte_py_sdk.api.cloudsave.models as cloudsave_models
result, error = cloudsave_service.admin_delete_player_record_handler_v1(
key="SomeCloudSaveKey",
user_id="********************************",
)
if error:
exit(error)
AdminPlayerRecord adminPlayerRecordWrapper = new AdminPlayerRecord(sdk);
String key = "playerInformation";
String userId = "<user-id>";
try {
adminPlayerRecordWrapper.adminDeletePlayerRecordHandlerV1(AdminDeletePlayerRecordHandlerV1.builder()
.namespace("<namespace>")
.userId(userId)
.key(key)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
string key = "characterLocation";
string userId = "<user-id>";
sdk.Cloudsave.AdminPlayerRecord.AdminDeletePlayerRecordHandlerV1Op
.Execute(key, sdk.Namespace, userId);