グループをゲームに統合する
Overview
AccelByte Gaming Services (AGS) Group provides game developers a way to boost interaction between players that can increase overall player retention by allowing players to form a group, gather, interact, and collaborate to achieve common goals. In this guide, you will learn how to integrate groups into your game using the AGS Group service with Client SDK or Extend SDK.
This article walks you through how to:
- Integrate groups into your game with Client SDKs or Extend SDKs.
- Allow players to manage groups.
- Retrieve group information.
- Allow players to interact with groups.
- Send group-related notifications to the player.
Prerequisites
You will need access to:
- The AGS Admin Portal.
- The AccelByte Unreal SDK, Unity SDK or Extend SDK, including the required permissions:
- Client ID
- Client Secret
- The AGS Group API documentation for reference.
Manage groups
The following sections detail how to integrate group management into your game.
Create a new group
You can allow your players to create a new group once you have a group configuration in your namespace. The player who created the group will be group admin by default. Use the following function to create a new group:
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FAccelByteModelsCreateGroupRequest RequestContent = {};
RequestContent.ConfigurationCode = "YourGroupConfigurationCode";
RequestContent.GroupName = "YourGroupName";
RequestContent.GroupDescription = "YourGroupDescription";
RequestContent.GroupMaxMember = 50;
RequestContent.GroupType = EAccelByteGroupType::PUBLIC;
ApiClient->Group.CreateGroup(RequestContent, THandler<FAccelByteModelsGroupInformation>::CreateLambda([](const FAccelByteModelsGroupInformation& Result)
{
// Do something if CreateGroup succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if CreateGroup fails
}));
CreateGroupRequest createGroupRequest = new CreateGroupRequest
{
configurationCode = "YourGroupConfigurationCode",
groupName = "YourGroupName",
groupDescription = "YourGroupDescription",
groupMaxMember = 50,
groupType = GroupType.PUBLIC
};
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().CreateGroup(createGroupRequest, result =>
{
if (result.IsError)
{
// Do something if CreateGroup fails
Debug.Log($"Error CreateGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if CreateGroup succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FAccelByteModelsCreateGroupRequest RequestContent = {};
RequestContent.ConfigurationCode = "YourGroupConfigurationCode";
RequestContent.GroupName = "YourGroupName";
RequestContent.GroupDescription = "YourGroupDescription";
RequestContent.GroupMaxMember = 50;
RequestContent.GroupType = EAccelByteGroupType::PUBLIC;
ApiClient->Group.CreateV2Group(RequestContent, THandler<FAccelByteModelsGroupInformation>::CreateLambda([](const FAccelByteModelsGroupInformation& Result)
{
// Do something if CreateV2Group succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if CreateV2Group fails
}));
CreateGroupRequest createGroupRequest = new CreateGroupRequest
{
configurationCode = "YourGroupConfigurationCode",
groupName = "YourGroupName",
groupDescription = "YourGroupDescription",
groupMaxMember = 50,
groupType = GroupType.PUBLIC
};
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().CreateGroupV2(createGroupRequest, result =>
{
if (result.IsError)
{
// Do something if CreateGroupV2 fails
Debug.Log($"Error CreateGroupV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if CreateGroupv2 succeeds
});
groupService := &group.GroupService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
configurationCode := "myconfigurationcode"
groupName := "mygroupname"
groupDescription := "mygroupdescription"
groupMaxMember := int32(50)
groupType := groupclientmodels.ModelsUpdateGroupRequestV1GroupTypePUBLIC
body := groupclientmodels.ModelsPublicCreateNewGroupRequestV1 {
ConfigurationCode: &configurationCode,
GroupName: &groupName,
GroupDescription: &groupDescription,
GroupMaxMember: &groupMaxMember,
GroupType: &groupType,
}
namespace := "mygame"
input := &group_.CreateNewGroupPublicV2Params{
Body: &body,
Namespace: namespace,
}
result, err := groupService.CreateNewGroupPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
import accelbyte_py_sdk.api.group.models as group_models
result, error = group_service.create_new_group_public_v2(
body=group_models.ModelsPublicCreateNewGroupRequestV1()
.with_configuration_code("YourConfigurationCode")
.with_group_name("YourGroupName")
.with_group_description("YourGroupDescription")
.with_group_max_member(50)
.with_group_type("PUBLIC"),
)
if error:
exit(error)
final Group groupWrapper = new Group(sdk);
ModelsPublicCreateNewGroupRequestV1 reqBody = ModelsPublicCreateNewGroupRequestV1.builder()
.configurationCode("YourGroupConfigurationCode")
.groupName("YourGroupName")
.groupDescription("YourGroupDescription")
.groupMaxMember(50)
.groupType(ModelsPublicCreateNewGroupRequestV1.GroupType.PUBLIC.name())
.build();
ModelsGroupResponseV1 response;
try {
response = groupWrapper.createNewGroupPublicV2(CreateNewGroupPublicV2.builder()
.namespace("<namespace>")
.body(reqBody)
.build());
} catch (Exception e) {
// Do something when there is an error
return;
}
// Do something if successful
var response = sdk.Group.Group.CreateNewGroupPublicV2Op
.Execute(new ModelsPublicCreateNewGroupRequestV1()
{
ConfigurationCode = "YourGroupConfigurationCode",
GroupName = "YourGroupName",
GroupDescription = "YourGroupDescription",
GroupMaxMember = 50,
GroupType = ModelsPublicCreateNewGroupRequestV1GroupType.PUBLIC
}, sdk.Namespace);
if (response != null)
{
//do something when success
}
Update group information
Information that is tied to a specific group, such as a group name, icon, description, region, or type, can be updated. Only members with an admin role can update the group's information. Use this function to update group information:
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
bool bCompletelyReplace = true;
FAccelByteModelsGroupUpdatable UpdateContent = {};
UpdateContent.GroupName = "UpdatedGroupName";
UpdateContent.GroupDescription = "UpdatedGroupDescription";
UpdateContent.GroupType = EAccelByteGroupType::PRIVATE;
ApiClient->Group.UpdateGroup(GroupId, bCompletelyReplace, UpdateContent, THandler<FAccelByteModelsGroupInformation>::CreateLambda([](const FAccelByteModelsGroupInformation& Result)
{
// Do something if UpdateGroup succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateGroup fails
}));
string groupId = "YourGroupId";
UpdateGroupRequest updateGroupRequest = new UpdateGroupRequest
{
groupName = "UpdatedGroupName",
groupDescription = "UpdatedGroupDescription",
groupType = GroupType.PRIVATE
};
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().UpdateGroup(groupId, updateGroupRequest, result =>
{
if (result.IsError)
{
// Do something if UpdateGroup fails
Debug.Log($"Error UpdateGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if UpdateGroup succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FAccelByteModelsUpdateGroupRequest UpdateContent = {};
UpdateContent.GroupName = "UpdatedGroupName";
UpdateContent.GroupDescription = "UpdatedGroupDescription";
UpdateContent.GroupType = EAccelByteGroupType::PRIVATE;
ApiClient->Group.UpdateV2Group(GroupId, UpdateContent, THandler<FAccelByteModelsGroupInformation>::CreateLambda([](const FAccelByteModelsGroupInformation& Result)
{
// Do something if UpdateV2Group succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateV2Group fails
}));
string groupId = "YourGroupId";
UpdateGroupRequest updateGroupRequest = new UpdateGroupRequest
{
groupName = "UpdatedGroupName",
groupDescription = "UpdatedGroupDescription",
groupType = GroupType.PRIVATE
};
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().UpdateGroupV2(groupId, updateGroupRequest, result =>
{
if (result.IsError)
{
// Do something if UpdateGroupV2 fails
Debug.Log($"Error UpdateGroupV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if UpdateGroupV2 succeeds
});
groupService := &group.GroupService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupName := "mygroupname"
groupDescription := "mygroupdescription"
groupType := groupclientmodels.ModelsUpdateGroupRequestV1GroupTypePRIVATE
body := groupclientmodels.ModelsUpdateGroupRequestV1 {
GroupName: &groupName,
GroupDescription: &groupDescription,
GroupType: &groupType,
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_.UpdatePutSingleGroupPublicV2Params{
Body: &body,
GroupID: groupId,
Namespace: namespace,
}
result, err := groupService.UpdatePutSingleGroupPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
import accelbyte_py_sdk.api.group.models as group_models
result, error = group_service.update_put_single_group_public_v2(
body=group_models.ModelsUpdateGroupRequestV1()
.with_group_name("YourGroupName")
.with_group_description("YourGroupDescription")
.with_group_type("PRIVATE"),
group_id="GroupId",
)
if error:
exit(error)
final Group groupWrapper = new Group(sdk);
ModelsUpdateGroupRequestV1 reqBody = ModelsUpdateGroupRequestV1.builder()
.groupName("UpdatedGroupName")
.groupDescription("UpdatedGroupDescription")
.groupType(ModelsPublicCreateNewGroupRequestV1.GroupType.PRIVATE.name())
.build();
ModelsGroupResponseV1 response;
try {
response = groupWrapper.updatePutSingleGroupPublicV2(UpdatePutSingleGroupPublicV2.builder()
.namespace("<namespace")
.groupId("<groupId>")
.body(reqBody)
.build());
} catch (Exception e) {
// Do something if there is an an error
return;
}
// Do something if successful
string groupId = "<group-id>";
var response = sdk.Group.Group.UpdatePutSingleGroupPublicV2Op
.Execute(new ModelsUpdateGroupRequestV1()
{
GroupName = "YourGroupName",
GroupDescription = "YourGroupDescription",
GroupType = ModelsUpdateGroupRequestV1GroupType.PRIVATE
}, groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Update a group's custom attributes
You can update a group's custom attributes separately using this function. Just like updating group information, only members with an admin role can update the group's custom attributes.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
FJsonObjectWrapper UpdatedCustomAttributes;
UpdatedCustomAttributes.JsonObject = MakeShared<FJsonObject>();
UpdatedCustomAttributes.JsonObject->SetStringField("Attribute String Key", "Updated Attribute");
FAccelByteModelsUpdateGroupCustomAttributesRequest UpdateContent = {};
UpdateContent.CustomAttributes = UpdatedCustomAttributes;
ApiClient->Group.UpdateGroupCustomAttributes(GroupId, UpdateContent, THandler<FAccelByteModelsGroupInformation>::CreateLambda([](const FAccelByteModelsGroupInformation& Result)
{
// Do something if UpdateGroupCustomAttributes succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateGroupCustomAttributes fails
}));
string groupId = "YourGroupId";
Dictionary<string, object> updateGroupRequest = new Dictionary<string, object>
{
{"Attribute String Key", "Updated Attribute" }
};
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().UpdateGroupCustomAttributes(groupId, updateGroupRequest, result =>
{
if (result.IsError)
{
// Do something if UpdateGroupCustomAttributes fails
Debug.Log($"Error UpdateGroupCustomAttributes, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if UpdateGroupCustomAttributes succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
FJsonObjectWrapper UpdatedCustomAttributes;
UpdatedCustomAttributes.JsonObject = MakeShared<FJsonObject>();
UpdatedCustomAttributes.JsonObject->SetStringField("Attribute String Key", "Updated Attribute");
FAccelByteModelsUpdateGroupCustomAttributesRequest UpdateContent = {};
UpdateContent.CustomAttributes = UpdatedCustomAttributes;
ApiClient->Group.UpdateV2GroupCustomAttributes(GroupId, UpdateContent, THandler<FAccelByteModelsGroupInformation>::CreateLambda([](const FAccelByteModelsGroupInformation& Result)
{
// Do something if UpdateV2GroupCustomAttributes succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateV2GroupCustomAttributes fails
}));
string groupId = "YourGroupId";
Dictionary<string, object> updateGroupRequest = new Dictionary<string, object>
{
{"Attribute String Key", "Updated Attribute" }
};
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().UpdateGroupCustomAttributesV2(groupId, updateGroupRequest, result =>
{
if (result.IsError)
{
// Do something if UpdateGroupCustomAttributesV2 fails
Debug.Log($"Error UpdateGroupCustomAttributesV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if UpdateGroupCustomAttributesV2 succeeds
});
groupService := &group.GroupService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
body := groupclientmodels.ModelsUpdateGroupCustomAttributesRequestV1 {
CustomAttributes: map[string]interface{}{
"Attribute String Key": "Updated Attribute",
},
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_.UpdateGroupCustomAttributesPublicV2Params{
Body: &body,
GroupID: groupId,
Namespace: namespace,
}
result, err := groupService.UpdateGroupCustomAttributesPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
import accelbyte_py_sdk.api.group.models as group_models
result, error = group_service.update_group_custom_attributes_public_v2(
body=group_models.ModelsUpdateGroupCustomAttributesRequestV1()
.with_custom_attributes(
{
"AttributeKey": "UpdatedAttributeValue",
}
),
group_id="GroupId",
)
if error:
exit(error)
final Group groupWrapper = new Group(sdk);
Map<String, String> customAttributesMap = new HashMap<>();
customAttributesMap.put("Attribute String Key", "Updated Attribute");
ModelsUpdateGroupCustomAttributesRequestV1 reqBody = ModelsUpdateGroupCustomAttributesRequestV1.builder()
.customAttributes(customAttributesMap)
.build();
ModelsGroupResponseV1 response;
try {
response = groupWrapper.updateGroupCustomAttributesPublicV2(UpdateGroupCustomAttributesPublicV2.builder()
.namespace("<namespace")
.groupId("<groupId>")
.body(reqBody)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
// Do something if successful
string groupId = "<group-id>";
var response = sdk.Group.Group.UpdateGroupCustomAttributesPublicV2Op
.Execute(new ModelsUpdateGroupCustomAttributesRequestV1()
{
CustomAttributes = new Dictionary<string, object>()
{
{ "Attribute String Key", "Updated Attribute" }
}
}, groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Display group information
The following sections detail how to display different types of group information.
Retrieve a list of groups
You can allow your players to search the available groups created by the players by searching using a group name or region. The results will be appear in pages, and you can use offset and limit parameters to limit the list. Use the following function to retrieve a list of groups:
The function below only shows PUBLIC and OPEN groups. You can learn more about group types in the section on group interactions.
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FAccelByteModelsGetGroupListRequest FilterContent = {};
FilterContent.GroupName = "YourGroupName";
FilterContent.GroupRegion = "US";
ApiClient->Group.GetGroupList(FilterContent, THandler<FAccelByteModelsGetGroupListResponse>::CreateLambda([](const FAccelByteModelsGetGroupListResponse& Result)
{
// Do something if GetGroupList succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetGroupList fails
}));
string groupName = "YourGroupName";
string groupRegion = "US";
int limit = 100;
int offset = 0;
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().SearchGroups(groupName, groupRegion, limit, offset, result =>
{
if (result.IsError)
{
// Do something if SearchGroups fails
Debug.Log($"Error SearchGroups, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if SearchGroups succeeds
});
groupService := &group.GroupService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
groupName := "groupname"
groupRegion := "US"
limit := int64(100)
offset := int64(0)
input := &group_.GetGroupListPublicV1Params{
Namespace: namespace,
GroupName: &groupName,
GroupRegion: &groupRegion,
Limit: &limit,
Offset: &offset,
}
result, err := groupService.GetGroupListPublicV1Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.get_group_list_public_v1(
group_name="YourGroupName",
group_region="US",
limit=100,
offset=0,
)
if error:
exit(error)
final Group groupWrapper = new Group(sdk);
ModelsGetGroupsListResponseV1 response;
try {
response = groupWrapper.getGroupListPublicV1(GetGroupListPublicV1.builder()
.namespace("<namespace>")
.groupName("YourGroupName")
.groupRegion("US")
.limit(100)
.offset(0)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
var response = sdk.Group.Group.GetGroupListPublicV1Op
.SetGroupName("YourGroupName")
.SetGroupRegion("US")
.SetOffset(0)
.SetLimit(100)
.Execute(sdk.Namespace);
if (response != null)
{
//do something when success
}
Retrieve group information by group ID
To give more clear information about the group to the players, you can use the following function to get information about a group by using the group ID:
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.GetGroup(GroupId, THandler<FAccelByteModelsGroupInformation>::CreateLambda([](const FAccelByteModelsGroupInformation& Result)
{
// Do something if GetGroup succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetGroup fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().GetGroup(groupId, result =>
{
if (result.IsError)
{
// Do something if GetGroup fails
Debug.Log($"Error GetGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetGroup succeeds
});
groupService := &group.GroupService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_.GetSingleGroupPublicV1Params{
GroupID: groupId,
Namespace: namespace,
}
result, err := groupService.GetSingleGroupPublicV1Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.get_single_group_public_v1(
group_id="GroupId",
)
if error:
exit(error)
final Group groupWrapper = new Group(sdk);
String groupId = "YourGroupId";
ModelsGroupResponseV1 response;
try {
response = groupWrapper.getSingleGroupPublicV1(GetSingleGroupPublicV1.builder()
.namespace("<namespace>")
.groupId(groupId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
var response = sdk.Group.Group.GetSingleGroupPublicV1Op
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Retrieve group information by user ID
You can let your players get their group information by using their user Id with the following function:
If the player you requested doesn't belong to any group, the returned status will be ErrorCode.UserNotBelongToAnyGroup
, and the player will be able to be invited to a group.
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
ApiClient->Group.GetUserGroupInfoByUserId(UserId, THandler<FAccelByteModelsGetUserGroupInfoResponse>::CreateLambda([](const FAccelByteModelsGetUserGroupInfoResponse& Result)
{
// Do something if GetUserGroupInfoByUserId succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetUserGroupInfoByUserId fails
}));
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().GetMyGroupInfo(result =>
{
if (result.IsError)
{
// Do something if GetMyGroupInfo fails
Debug.Log($"Error GetMyGroupInfo, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetMyGroupInfo succeeds
})
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
userId := "myuserid"
input := &group_member.GetUserGroupInformationPublicV1Params{
Namespace: namespace,
UserID: userId,
}
result, err := groupMemberService.GetUserGroupInformationPublicV1Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.get_user_group_information_public_v1(
user_id="********************************",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String userId = "YourUserId";
ModelsGetUserGroupInformationResponseV1 response;
try {
response = groupMemberWrapper.getUserGroupInformationPublicV1(GetUserGroupInformationPublicV1.builder()
.namespace("<namespace>")
.userId(userId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string userId = "<user-id>";
var response = sdk.Group.GroupMember.GetUserGroupInformationPublicV1Op
.Execute(sdk.Namespace, userId);
if (response != null)
{
//do something when success
}
Retrieve a player's group information
You can allow your player to retrieve the group information of the user with a specific user Id.
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
ApiClient->Group.GetUserGroupInfoByUserId(UserId, THandler<FAccelByteModelsGetUserGroupInfoResponse>::CreateLambda([](const FAccelByteModelsGetUserGroupInfoResponse& Result)
{
// Do something if GetUserGroupInfoByUserId succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetUserGroupInfoByUserId fails
}));
string userId = "YourUserId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().GetOtherGroupInfo(userId, result =>
{
if (result.IsError)
{
// Do something if GetOtherGroupInfo fails
Debug.Log($"Error GetOtherGroupInfo, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetOtherGroupInfo succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
userId := "myuserid"
input := &group_member.GetUserGroupInformationPublicV1Params{
Namespace: namespace,
UserID: userId,
}
result, err := groupMemberService.GetUserGroupInformationPublicV1Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.get_user_group_information_public_v1(
user_id="********************************",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String userId = "YourUserId";
ModelsGetUserGroupInformationResponseV1 response;
try {
response = groupMemberWrapper.getUserGroupInformationPublicV1(GetUserGroupInformationPublicV1.builder()
.namespace("<namespace>")
.userId(userId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string userId = "<user-id>";
var response = sdk.Group.GroupMember.GetUserGroupInformationPublicV1Op
.Execute(sdk.Namespace, userId);
if (response != null)
{
//do something when success
}
Retrieve a group's member list
You can let your players retrieve a list of members within a specific group. Use the following function to get a group's member list by using a group Id.
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
FAccelByteModelsGetGroupMembersListByGroupIdRequest RequestContent = {};
RequestContent.Limit = 100;
RequestContent.Offset = 0;
RequestContent.SortBy = EAccelByteGroupListSortBy::ASCENDING;
ApiClient->Group.GetGroupMembersListByGroupId(GroupId, RequestContent, THandler<FAccelByteModelsGetGroupMemberListResponse>::CreateLambda([](const FAccelByteModelsGetGroupMemberListResponse& Result)
{
// Do something if GetGroupMembersListByGroupId succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetGroupMembersListByGroupId fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().GetGroupMemberList(groupId, result =>
{
if (result.IsError)
{
// Do something if GetGroupMemberList fails
Debug.Log($"Error GetGroupMemberList, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetGroupMemberList succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
limit := int64(100)
offset := int64(0)
input := &group_member.GetGroupMembersListPublicV1Params{
GroupID: groupId,
Namespace: namespace,
Limit: &limit,
Offset: &offset,
}
result, err := groupMemberService.GetGroupMembersListPublicV1Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.get_group_members_list_public_v1(
limit=100,
offset=0,
)
if error:
exit(error)
ModelsGetGroupMemberListResponseV1 response;
try {
response = groupMemberWrapper.getGroupMembersListPublicV1(GetGroupMembersListPublicV1.builder()
.namespace("<namespace>")
.groupId(groupId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
var response = sdk.Group.GroupMember.GetGroupMembersListPublicV1Op
.SetOffset(0)
.SetLimit(100)
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Interact with groups
The follow sections details players' interactions with groups.
Join a group
Players can request to join OPEN or PUBLIC groups. Each group type will have a different behavior:
- OPEN groups will allow players to automatically join.
- PUBLIC groups will require players to make a join request which needs to be approved by a group admin before the player can join.
Use the following function to allow players join to a specific group.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.JoinGroup(GroupId, THandler<FAccelByteModelsJoinGroupResponse>::CreateLambda([](const FAccelByteModelsJoinGroupResponse& Result)
{
// Do something if JoinGroup succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if JoinGroup fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().JoinGroup(groupId, result =>
{
if (result.IsError)
{
// Do something if JoinGroup fails
Debug.Log($"Error JoinGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if JoinGroup succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.JoinV2Group(GroupId, THandler<FAccelByteModelsJoinGroupResponse>::CreateLambda([](const FAccelByteModelsJoinGroupResponse& Result)
{
// Do something if JoinV2Group succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if JoinV2Group fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().JoinGroupV2(groupId, result =>
{
if (result.IsError)
{
// Do something if JoinGroupV2 fails
Debug.Log($"Error JoinGroupV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if JoinGroupV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_member.JoinGroupV2Params{
GroupID: groupId,
Namespace: namespace,
}
result, err := groupMemberService.JoinGroupV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.join_group_v2(
group_id="GroupId",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String groupId = "YourGroupId";
ModelsJoinGroupResponseV1 response;
try {
response = groupMemberWrapper.joinGroupV2(JoinGroupV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
var response = sdk.Group.GroupMember.JoinGroupV2Op
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Cancel a join request
After a player requests to join a PUBLIC group, that request can be canceled.
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.CancelJoinGroupRequest(GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if CancelJoinGroupRequest succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if CancelJoinGroupRequest fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().CancelJoinGroupRequest(groupId, result =>
{
if (result.IsError)
{
// Do something if JoinGroupV2 fails
Debug.Log($"Error JoinGroupV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if JoinGroupV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_member.CancelGroupJoinRequestV1Params{
GroupID: groupId,
Namespace: namespace,
}
result, err := groupMemberService.CancelGroupJoinRequestV1Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.cancel_group_join_request_v1(
group_id="GroupId",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String groupId = "YourGroupId";
ModelsMemberRequestGroupResponseV1 response;
try {
response = groupMemberWrapper.cancelGroupJoinRequestV1(CancelGroupJoinRequestV1.builder()
.namespace("<namespace>")
.groupId(groupId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
var response = sdk.Group.GroupMember.CancelGroupJoinRequestV1Op
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Leave a group
To allow players to leave a group, you can use the following function:
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
ApiClient->Group.LeaveGroup(THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if LeaveGroup succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if LeaveGroup fails
}));
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().LeaveGroup(result =>
{
if (result.IsError)
{
// Do something if LeaveGroup fails
Debug.Log($"Error LeaveGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if LeaveGroup succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.LeaveV2Group(GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if LeaveV2Group succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if LeaveV2Group fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().LeaveGroupV2(groupId, result =>
{
if (result.IsError)
{
// Do something if LeaveGroupV2 fails
Debug.Log($"Error LeaveGroupV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if LeaveGroupV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_member.LeaveGroupPublicV2Params{
GroupID: groupId,
Namespace: namespace,
}
result, err := groupMemberService.LeaveGroupPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.leave_group_public_v2(
group_id="GroupId",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String groupId = "YourGroupId";
ModelsLeaveGroupResponseV1 response;
try {
response = groupMemberWrapper.leaveGroupPublicV2(LeaveGroupPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
var response = sdk.Group.GroupMember.LeaveGroupPublicV2Op
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Invite a player to a group
Group admins can invite players to join their group. A PRIVATE group can use this function to add new members. Players need to accept the invitation before they can join the group.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
ApiClient->Group.InviteUserToGroup(UserId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if InviteUserToGroup succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if InviteUserToGroup fails
}));
string userId = "YourUserId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().InviteOtherUserToGroup(userId, result =>
{
if (result.IsError)
{
// Do something if InviteOtherUserToGroup fails
Debug.Log($"Error InviteOtherUserToGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if InviteOtherUserToGroup succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
FString GroupId = "YourGroupId";
ApiClient->Group.InviteUserToV2Group(UserId, GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if InviteUserToV2Group succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if InviteUserToV2Group fails
}));
string userId = "YourUserId";
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().InviteOtherUserToGroupV2(userId, groupId, result =>
{
if (result.IsError)
{
// Do something if InviteOtherUserToGroupV2 fails
Debug.Log($"Error InviteOtherUserToGroupV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if InviteOtherUserToGroupV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
userId := "myuserid"
input := &group_member.InviteGroupPublicV2Params{
GroupID: groupId,
Namespace: namespace,
UserID: userId,
}
result, err := groupMemberService.InviteGroupPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.invite_group_public_v2(
group_id="GroupId",
user_id="********************************",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String groupId = "YourGroupId";
String userId = "YourUserId";
ModelsUserInvitationResponseV1 response;
try {
response = groupMemberWrapper.inviteGroupPublicV2(InviteGroupPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.userId(userId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
string userId = "<user-id>";
var response = sdk.Group.GroupMember.InviteGroupPublicV2Op
.Execute(groupId, sdk.Namespace, userId);
if (response != null)
{
//do something when success
}
Remove/kick a group member
Group admins can also remove (kick) group members from the group.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
ApiClient->Group.KickGroupMember(UserId, THandler<FAccelByteModelsKickGroupMemberResponse>::CreateLambda([](const FAccelByteModelsKickGroupMemberResponse& Result)
{
// Do something if KickGroupMember succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if KickGroupMember fails
}));
string userId = "YourUserId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().KickGroupMember(userId, result =>
{
if (result.IsError)
{
// Do something if KickGroupMember fails
Debug.Log($"Error KickGroupMember, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if KickGroupMember succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
FString GroupId = "YourGroupId";
ApiClient->Group.KickV2GroupMember(UserId, GroupId, THandler<FAccelByteModelsKickGroupMemberResponse>::CreateLambda([](const FAccelByteModelsKickGroupMemberResponse& Result)
{
// Do something if KickV2GroupMember succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if KickV2GroupMember fails
}));
string userId = "YourUserId";
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().KickGroupMemberV2(userId, groupId, result =>
{
if (result.IsError)
{
// Do something if KickGroupMemberV2 fails
Debug.Log($"Error KickGroupMemberV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if KickGroupMemberV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
userId := "myuserid"
input := &group_member.KickGroupMemberPublicV2Params{
GroupID: groupId,
Namespace: namespace,
UserID: userId,
}
result, err := groupMemberService.KickGroupMemberPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.kick_group_member_public_v2(
group_id="GroupId",
user_id="********************************",
)
if error:
exit(error)
final MemberRequest memberRequestWrapper = new MemberRequest(sdk);
int limit = 100;
int offset = 0;
ModelsGetMemberRequestsListResponseV1 response;
try {
response = memberRequestWrapper.getGroupInvitationRequestPublicV1(GetGroupInvitationRequestPublicV1.builder()
.namespace("<namespace>")
.limit(limit)
.offset(offset)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
```java
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String groupId = "YourGroupId";
String userId = "YourUserId";
ModelsKickGroupMemberResponseV1 response;
try {
response = groupMemberWrapper.kickGroupMemberPublicV2(KickGroupMemberPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.userId(userId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
string userId = "<user-id>";
var response = sdk.Group.GroupMember.KickGroupMemberPublicV2Op
.Execute(groupId, sdk.Namespace, userId);
if (response != null)
{
//do something when success
}
Get a list of group invitation requests
Players can get the list of group invitation requests to either accept or reject these invitations.
- Unreal Engine
- Unity
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FAccelByteModelsLimitOffsetRequest RequestContent = {};
RequestContent.Limit = 100;
RequestContent.Offset = 0;
ApiClient->Group.GetGroupInvitationRequests(RequestContent, THandler<FAccelByteModelsGetMemberRequestsListResponse>::CreateLambda([](const FAccelByteModelsGetMemberRequestsListResponse& Result)
{
// Do something if GetGroupInvitationRequests succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetGroupInvitationRequests fails
}));
int limit = 100;
int offset = 0;
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().GetGroupInvitationRequests(limit, offset, result =>
{
if (result.IsError)
{
// Do something if GetGroupInvitationRequests fails
Debug.Log($"Error GetGroupInvitationRequests, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetGroupInvitationRequests succeeds
});
memberRequestService := &group.MemberRequestService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
limit := int64(100)
offset := int64(0)
input := &member_request.GetGroupInvitationRequestPublicV1Params{
Namespace: namespace,
Limit: &limit,
Offset: &offset,
}
result, err := memberRequestService.GetGroupInvitationRequestPublicV1Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.get_group_invitation_request_public_v1(
limit=100,
offset=0,
)
if error:
exit(error)
var response = sdk.Group.MemberRequest.GetGroupInvitationRequestPublicV1Op
.SetOffset(0)
.SetLimit(100)
.Execute(sdk.Namespace);
if (response != null)
{
//do something when success
}
Accept a group invitation request
After getting the invitation list, players can accept an invitation.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.AcceptGroupInvitation(GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if AcceptGroupInvitation succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if AcceptGroupInvitation fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().AcceptGroupInvitation(groupId, result =>
{
if (result.IsError)
{
// Do something if AcceptGroupInvitation fails
Debug.Log($"Error AcceptGroupInvitation, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if AcceptGroupInvitation succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.AcceptGroupInvitation(GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if AcceptGroupInvitation succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if AcceptGroupInvitation fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().AcceptGroupInvitationV2(groupId, result =>
{
if (result.IsError)
{
// Do something if AcceptGroupInvitationV2 fails
Debug.Log($"Error AcceptGroupInvitationV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if AcceptGroupInvitationV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_member.AcceptGroupInvitationPublicV2Params{
GroupID: groupId,
Namespace: namespace,
}
result, err := groupMemberService.AcceptGroupInvitationPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.accept_group_invitation_public_v2(
group_id="GroupId",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String groupId = "YourGroupId";
ModelsMemberRequestGroupResponseV1 response;
try {
response = groupMemberWrapper.acceptGroupInvitationPublicV2(AcceptGroupInvitationPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
var response = sdk.Group.GroupMember.AcceptGroupInvitationPublicV2Op
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Reject a group invitation request
Players can reject any invitation request.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.RejectGroupInvitation(GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if RejectGroupInvitation succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if RejectGroupInvitation fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().RejectGroupInvitation(groupId, result =>
{
if (result.IsError)
{
// Do something if RejectGroupInvitation fails
Debug.Log($"Error RejectGroupInvitation, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if RejectGroupInvitation succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
ApiClient->Group.RejectV2GroupInvitation(GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if RejectV2GroupInvitation succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if RejectV2GroupInvitation fails
}));
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().RejectGroupInvitationV2(groupId, result =>
{
if (result.IsError)
{
// Do something if RejectGroupInvitationV2 fails
Debug.Log($"Error RejectGroupInvitationV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if RejectGroupInvitationV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
input := &group_member.RejectGroupInvitationPublicV2Params{
GroupID: groupId,
Namespace: namespace,
}
result, err := groupMemberService.RejectGroupInvitationPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.reject_group_invitation_public_v2(
group_id="GroupId",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String groupId = "YourGroupId";
ModelsMemberRequestGroupResponseV1 response;
try {
response = groupMemberWrapper.rejectGroupInvitationPublicV2(RejectGroupInvitationPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
var response = sdk.Group.GroupMember.RejectGroupInvitationPublicV2Op
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Get a list of group member join requests
Group admins can get a list of group member join requests to either approve or reject them.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
FAccelByteModelsLimitOffsetRequest RequestContent = {};
RequestContent.Limit = 100;
RequestContent.Offset = 0;
ApiClient->Group.GetGroupJoinRequests(GroupId, RequestContent, THandler<FAccelByteModelsGetMemberRequestsListResponse>::CreateLambda([](const FAccelByteModelsGetMemberRequestsListResponse& Result)
{
// Do something if GetGroupJoinRequests succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetGroupJoinRequests fails
}));
string groupId = "YourGroupId";
int limit = 100;
int offset = 0;
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().GetGroupJoinRequests(groupId, limit, offset, result =>
{
if (result.IsError)
{
// Do something if GetGroupJoinRequests fails
Debug.Log($"Error GetGroupJoinRequests, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetGroupJoinRequests succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString GroupId = "YourGroupId";
FAccelByteModelsLimitOffsetRequest RequestContent = {};
RequestContent.Limit = 100;
RequestContent.Offset = 0;
ApiClient->Group.GetGroupJoinRequestList(GroupId, RequestContent, THandler<FAccelByteModelsGetMemberRequestsListResponse>::CreateLambda([](const FAccelByteModelsGetMemberRequestsListResponse& Result)
{
// Do something if GetGroupJoinRequestList succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetGroupJoinRequestList fails
}));
string groupId = "YourGroupId";
int limit = 100;
int offset = 0;
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().GetGroupJoinRequestsV2(groupId, limit, offset, result =>
{
if (result.IsError)
{
// Do something if GetGroupJoinRequestsV2 fails
Debug.Log($"Error GetGroupJoinRequestsV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetGroupJoinRequestsV2 succeeds
});
memberRequestService := &group.MemberRequestService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
limit := int64(100)
offset := int64(0)
input := &member_request.GetGroupJoinRequestPublicV2Params{
GroupID: groupId,
Namespace: namespace,
Limit: &limit,
Offset: &offset,
}
result, err := memberRequestService.GetGroupJoinRequestPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.get_group_join_request_public_v2(
group_id="GroupId",
limit=100,
offset=0,
)
if error:
exit(error)
final MemberRequest memberRequestWrapper = new MemberRequest(sdk);
String groupId = "YourGroupId";
int limit = 100;
int offset = 0;
ModelsGetMemberRequestsListResponseV1 response;
try {
response = memberRequestWrapper.getGroupJoinRequestPublicV2(GetGroupJoinRequestPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.limit(limit)
.offset(offset)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
var response = sdk.Group.MemberRequest.GetGroupJoinRequestPublicV2Op
.SetOffset(0)
.SetLimit(100)
.Execute(groupId, sdk.Namespace);
if (response != null)
{
//do something when success
}
Accept a group member join request
After getting the list of join requests, a group admin can accept them to the group.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
ApiClient->Group.AcceptGroupJoinRequest(UserId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if AcceptGroupJoinRequest succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if AcceptGroupJoinRequest fails
}));
string userId = "YourUserId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().AcceptOtherJoinRequest(userId, result =>
{
if (result.IsError)
{
// Do something if AcceptOtherJoinRequest fails
Debug.Log($"Error AcceptOtherJoinRequest, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if AcceptOtherJoinRequest succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
FString GroupId = "YourGroupId";
ApiClient->Group.AcceptV2GroupJoinRequest(UserId, GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if AcceptV2GroupJoinRequest succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if AcceptV2GroupJoinRequest fails
}));
string userId = "YourUserId";
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().AcceptOtherJoinRequestV2(userId, groupId, result =>
{
if (result.IsError)
{
// Do something if AcceptOtherJoinRequestV2 fails
Debug.Log($"Error AcceptOtherJoinRequestV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if AcceptOtherJoinRequestV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
userId := "myuserid"
input := &group_member.AcceptGroupJoinRequestPublicV2Params{
GroupID: groupId,
Namespace: namespace,
UserID: userId,
}
result, err := groupMemberService.AcceptGroupJoinRequestPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.accept_group_join_request_public_v2(
group_id="GroupId",
user_id="********************************",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String userId = "YourUserId";
String groupId = "YourGroupId";
ModelsMemberRequestGroupResponseV1 response;
try {
response = groupMemberWrapper.acceptGroupJoinRequestPublicV2(AcceptGroupJoinRequestPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.userId(userId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
string userId = "<user-id>";
var response = sdk.Group.GroupMember.AcceptGroupJoinRequestPublicV2Op
.Execute(groupId, sdk.Namespace, userId);
if (response != null)
{
//do something when success
}
Reject a group member join request
Group admins can reject any member join request.
- Unreal Engine V1
- Unity V1
- Unreal Engine V2
- Unity V2
- Go Extend SDK
- Python Extend SDK
- Java Extend SDK
- C# Extend SDK
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
ApiClient->Group.RejectGroupJoinRequest(UserId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if RejectGroupJoinRequest succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if RejectGroupJoinRequest fails
}));
string userId = "YourUserId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().RejectOtherJoinRequest(userId, result =>
{
if (result.IsError)
{
// Do something if RejectOtherJoinRequest fails
Debug.Log($"Error RejectOtherJoinRequest, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if RejectOtherJoinRequest succeeds
});
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "YourUserId";
FString GroupId = "YourGroupId";
ApiClient->Group.RejectV2GroupJoinRequest(UserId, GroupId, THandler<FAccelByteModelsMemberRequestGroupResponse>::CreateLambda([](const FAccelByteModelsMemberRequestGroupResponse& Result)
{
// Do something if RejectV2GroupJoinRequest succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if RejectV2GroupJoinRequest fails
}));
string userId = "YourUserId";
string groupId = "YourGroupId";
AccelByteSDK.GetClientRegistry().GetApi().GetGroup().RejectOtherJoinRequestV2(userId, groupId, result =>
{
if (result.IsError)
{
// Do something if RejectOtherJoinRequestV2 fails
Debug.Log($"Error RejectOtherJoinRequestV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if RejectOtherJoinRequestV2 succeeds
});
groupMemberService := &group.GroupMemberService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
groupId := "mygroupid"
namespace := "mygame"
userId := "myuserid"
input := &group_member.RejectGroupJoinRequestPublicV2Params{
GroupID: groupId,
Namespace: namespace,
UserID: userId,
}
result, err := groupMemberService.RejectGroupJoinRequestPublicV2Short(input)
import accelbyte_py_sdk.api.group as group_service
result, error = group_service.reject_group_join_request_public_v2(
group_id="GroupId",
user_id="********************************",
)
if error:
exit(error)
final GroupMember groupMemberWrapper = new GroupMember(sdk);
String userId = "YourUserId";
String groupId = "YourGroupId";
ModelsMemberRequestGroupResponseV1 response;
try {
response = groupMemberWrapper.rejectGroupJoinRequestPublicV2(RejectGroupJoinRequestPublicV2.builder()
.namespace("<namespace>")
.groupId(groupId)
.userId(userId)
.build());
} catch (Exception e) {
// Do something if there is an error
return;
}
string groupId = "<group-id>";
string userId = "<user-id>";
var response = sdk.Group.GroupMember.RejectGroupJoinRequestPublicV2Op
.Execute(groupId, sdk.Namespace, userId);
if (response != null)
{
//do something when success
}