InviteGroupMember
Invite a user to the group.
Service | Operation |
---|---|
group | INVITE_MEMBER_TO_GROUP |
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 = "a-group-id";
string profileId = "a-profile-id";
Role role = Role.MEMBER;
string jsonAttributes = "{}";
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.InviteGroupMember(groupId, profileId, role, jsonAttributes, successCallback, failureCallback);
const char *groupId = "a-group-id";
const char *profileId = "a-profile-id";
eGroupMember::Role role = eGroupMember::MEMBER;
const char *jsonAttributes = "{}";
_bc->getGroup()->inviteGroupMember(groupId, profileId, role, jsonAttributes, this);
NSString *groupId = @"a-group-id";
NSString *profileId = @"a-profile-id";
Role role = MEMBER;
NSString *jsonAttributes = "{}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc groupService] inviteGroupMember:groupId
profileId:profileId
role:role
jsonAttributes:jsonAttributes
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String groupId = "a-group-id";
String profileId = "a-profile-id";
Role role = Role.MEMBER;
String jsonAttributes = "{}";
this; // implements IServerCallback
_bc.getGroup().inviteGroupMember(groupId, profileId, role, jsonAttributes, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var groupId = "a-group-id";
var profileId = "a-profile-id";
var role = "MEMBER";
var jsonAttributes = {};
_bc.group.inviteGroupMember(groupId, profileId, role, jsonAttributes, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var groupId = "a-group-id";
var profileId = "a-profile-id";
var role = "MEMBER";
var jsonAttributes = {};
ServerResponse result = await _bc.groupService.inviteGroupMember(groupId:groupId, profileId:profileId, role:role, attributes:jsonAttributes);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var groupId = "a-group-id";
var profileId = "a-profile-id";
var role = "MEMBER";
var jsonAttributes = {};
var groupProxy = bridge.getGroupServiceProxy();
var postResult = groupProxy.inviteGroupMember(groupId, profileId, role, jsonAttributes);
if (postResult.status == 200) {
// Success!
}
{
"groupId": "a-group-id",
"profileId": "a-profile-id",
"role": "MEMBER",
"attributes": {}
}
JSON Response
{
"status": 200,
"data": null
}