Skip to main content
Version: 5.7.0

CreateGroup

Create a group.

The group ACL contains two elements defining access to the groups data for non-members (other) and members. Access is defined as:

  • None = 0,
  • ReadOnly = 1
  • ReadWrite = 2
ServiceOperation
groupCREATE_GROUP

Method Parameters

ParameterDescription
nameName of the group
groupTypeName of the type of group
isOpenGrouptrue if group is open; false if closed
aclThe group's access control list. A null ACL implies default
jsonOwnerAttributesAttributes for the group owner (current user)
jsonDefaultMemberAttributesDefault attributes for group members
jsonDataCustom application data

Usage

http://localhost:3000
string name = "myGroupName";
string groupType = "myGroupType";
bool isOpenGroup = false;
GroupACL.Access memberAccess = GroupACL.Access.ReadWrite;
GroupACL.Access otherAccess = GroupACL.Access.None;
GroupACL acl = new GroupACL(otherAccess, memberAccess);
string jsonData = "{}";
string ownerAttributes = "{}";
string defaultMemberAttributes = "{}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.Group.CreateGroup(name, groupType, isOpenGroup, acl, jsonData, ownerAttributes, defaultMemberAttributes, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"gameId": "20595",
"groupId": "211559ef-234a-4aef-a643-48a90a6036c2",
"ownerId": "ee8cad26-16f2-4ef8-9045-3aab84ce6362",
"name": "my-group-name",
"groupType": "TestGroup",
"createdAt": 1461613090251,
"updatedAt": 1461613090251,
"members": {
"ee8cad26-16f2-4ef8-9045-3aab84ce6362": {
"role": "OWNER",
"attributes": {}
}
},
"pendingMembers": {},
"version": 1,
"data": {},
"isOpenGroup": false,
"defaultMemberAttributes": {},
"memberCount": 1,
"invitedPendingMemberCount": 0,
"requestingPendingMemberCount": 0,
"acl": {
"member": 2,
"other": 1
}
}
}