ApproveGroupJoinRequest
Approve an outstanding request to join the group. Optional parameters: jsonAttributes.
// Example group join request:
"data":{
...
"pendingMembers":{
"4a4f2434-2324-4a22-b61e-7e5b60da1575":{
"role":"MEMBER",
"attributes":{
},
"pendingReason":"ASKED_TO_JOIN"
}
},
...
}
Service | Operation |
---|---|
group | APPROVE_GROUP_JOIN_REQUEST |
Method Parameters
Parameter | Description |
---|---|
groupId | ID of the group |
profileId | Profile ID of the member being added |
role | Role of the member being added |
jsonAttributes | Attributes of the member being added |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string groupId = <%= data.example.groupId %>;
string profileId = <%= data.example.profileId %>;
BrainCloudGroup.Role role = BrainCloudGroup.Role.MEMBER;
string jsonAttributes = <%= data.example.jsonAttributes %>;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("[ApproveGroupJoinRequest Success] {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.GroupService.ApproveGroupJoinRequest(
groupId,
profileId,
role,
jsonAttributes,
successCallback,
failureCallback);
const char* groupId = <%= data.example.groupId %>;
const char* profileId = <%= data.example.profileId %>;
eGroupMember::Role role = eGroupMember::MEMBER;
std::string jsonAttributes = <%= data.example.jsonAttributes %>;
BrainCloudClient->getGroupService()->approveGroupJoinRequest(groupId, profileId, role, jsonAttributes, this);
NSString * groupId = @<%= data.example.groupId %>;
NSString * profileId = @<%= data.example.profileId %>;
GroupMemberRole role = MEMBER;
NSString * jsonAttributes = @<%= data.example.jsonAttributes %>;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc groupService]
approveGroupJoinRequest:groupId
profileId:profileId
role:role
jsonAttributes:jsonAttributes
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String groupId = <%= data.example.groupId %>;
String profileId = <%= data.example.profileId %>;
GroupService.Role role = GroupService.Role.MEMBER;
String jsonAttributes = <%= data.example.jsonAttributes %>;
<%= data.example.implementCallback %>
_bc.getGroupService().approveGroupJoinRequest(groupId, profileId, role, jsonAttributes, this);
var groupId = <%= data.example.groupId %>;
var profileId = <%= data.example.profileId %>;
var role = "MEMBER";
var jsonAttributes = <%= data.example.jsonAttributes_js %>;
_bc.group.approveGroupJoinRequest(groupId, profileId, role, attributes, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var groupId = <%= data.example.groupId %>;
var profileId = <%= data.example.profileId %>;
var role = "MEMBER";
var jsonAttributes = <%= data.example.jsonAttributes_js %>;
ServerResponse result = await _bc.groupService.approveGroupJoinRequest(groupId:groupId, profileId:profileId, role:role, attributes:attributes);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var groupId = <%= data.example.groupId %>;
var profileId = <%= data.example.profileId %>;
var role = "MEMBER";
var jsonAttributes = <%= data.example.jsonAttributes_js %>;
var groupProxy = bridge.getGroupServiceProxy();
var retVal = groupProxy.approveGroupJoinRequest(groupId, profileId, role, attributes);
{
"service": "group",
"operation": "APPROVE_GROUP_JOIN_REQUEST",
"data": {
"groupId": "a-group-id",
"profileId": "the-profile-id",
"role": "MEMBER",
"attributes": {}
}
}
JSON Response
{
"status": 200,
"data": null
}