This API enables the app backend to promptly view (and reject if so configured) group members' requests to add other users to the group.
The callback is triggered before the IM backend adds the target user to the group. (If relationship chain hosting exists and the app configures friend relationship verification in IM, this callback will be triggered after the friend relationship is verified as successful.)
In the following example, the callback URL configured in the app is https://www.example.com
.
Example:
https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json&ClientIP=$ClientIP&OptPlatform=$OptPlatform
Parameter | Description |
---|---|
https | The request protocol is HTTPS, and the request method is POST. |
www.example.com | The callback URL. |
SdkAppid | The SDKAppID assigned by the IM console when an app is created. |
CallbackCommand | Its value is fixed to Group.CallbackBeforeInviteJoinGroup. |
contenttype | Its value is fixed to JSON. |
ClientIP | The client IP address, for example, 127.0.0.1. |
OptPlatform | The client platform. For information on the possible values, see the description of the OptPlatform parameter in Third-Party Callback Overview: Callback Protocols. |
{
"CallbackCommand": "Group.CallbackBeforeInviteJoinGroup",
"GroupId": "@TGS#2J4SZEAEL",
"Type": "Public",
"Operator_Account": "leckie",
"DestinationMembers": [
{
"Member_Account": "jared"
},
{
"Member_Account": "leckie"
}
]
}
Field | Type | Description |
---|---|---|
CallbackCommand | String | Callback command |
GroupId | String | ID of the group to which a user is added |
Type | String | The type of the group to be created. For details, see Group Types. The group type can be Public. |
Operator_Account | String | Request operator’s UserID |
DestinationMembers | Array | Set of UserID s to be added to the group |
The app backend allows all users in requests to join the group.
{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0 // Indicates that the system can continue to process requests for adding users to the group.
}
The app backend rejects some users in requests to join the group and returns these users’ Identifier s in RefusedMembers_Account.
{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0,
"RefusedMembers_Account": [ // List of rejected users
"jared"
]
}
Field | Type | Attribute | Description |
---|---|---|---|
ActionStatus | String | Required | The request processing result. OK: succeeded. FAIL: failed. |
ErrorCode | Integer | Required | The error code.0: allows group buliding; 1: forbids group buliding; 2: discards the message silently.If the business side wants to use his own error code to forbid a user to bulid group and sendErrorCode and ErrorInfo to the client, ensure that the value of ErrorCode is set within the range of [10100, 10200]. |
ErrorInfo | String | Required | Error information. |
RefusedMembers_Account | Array | Optional | The set of rejected users’ IDs. |
Was this page helpful?