Callback Before Member Joins Group
Description
The App business server can use this callback to monitor information when a member attempts to join a group, including intercepting user profile data such as avatar, nickname, user permissions, and additional information before they join.
Important Notes
- To enable the callback, configure the callback URL and activate the corresponding protocol switch. For details, refer to the Callback Introduction document.
- The callback is initiated from the OpenIM Server to the App backend as an HTTP/HTTPS POST request.
- The App business server must respond within the specified timeout period.
Scenarios that Trigger This Callback
- The group owner initiates the creation of a group chat via the App client.
- The App administrator invites users to a group through the REST API.
- The App administrator processes group join requests via the REST API.
- A user joins a group via the App.
Timing of Callback
- Before OpenIM Server prepares to create the group chat.
- Before OpenIM Server approves a user joining the group.
Interface Description
Example Request URL
The CallbackCommand
here is: callbackBeforeMembersJoinGroupCommand
{WEBHOOK_ADDRESS}/callbackBeforeMembersJoinGroupCommand?contenttype=json
Example Request Package
{
"callbackCommand": "callbackBeforeMembersJoinGroupCommand",
"groupID": "12345",
"memberList": [
{
"userID": "666",
"ex": "337845818, 3q"
},
{
"userID": "1028",
"ex": "Are U OK"
}
],
"groupEx": "test Group"
}
Request Package Field Descriptions
Field | Type | Description |
---|---|---|
callbackCommand | string | Callback command, indicating a pre-join member callback here. |
groupID | string | Unique identifier of the group. |
memberList | array | List of members who will join the group, including user ID and extra info fields. |
memberList.userID | string | User ID of the member. |
memberList.ex | string | Additional information for the member. |
groupEx | string | Additional information for the group. |
Example Response Package
{
"actionCode": 0,
"errCode": 0,
"errMsg": "",
"errDlt": "",
"nextCode": 0,
"memberCallbackList": [
{
"userID": "3034068043",
"nickname": "3q",
"faceURL": "http://203.56.175.233:10002/third/object?name=%2Fdata%2Fuser%2F0%2Fcn.rentsoft.flutter.openim.consumer%2Fcache%2Fimage_cropper_1687330588901.jpg",
"roleLevel": 20,
"muteEndTime": 0,
"ex": "Some extra data"
},
{
"userID": "3034068043",
"nickname": "President Lei",
"faceURL": "http://203.56.175.233:10002/third/object?name=%2Fdata%2Fuser%2F0%2Fcn.rentsoft.flutter.openim.consumer%2Fcache%2Fimage_cropper_1687330588901.jpg",
"roleLevel": 100,
"muteEndTime": 0,
"ex": "Some extra data"
}
]
}
Response Package Field Descriptions
Field | Value | Description |
---|---|---|
actionCode | 0 | Indicates if the callback executed successfully. 0 means success. |
errCode | 5001 | Custom error code, ranging from 5000-9999. Set if actionCode is not 0. |
errMsg | "An error message" | Simple error message corresponding to the custom error code. |
errDlt | "Detailed error information" | Detailed error message for the custom error code. |
nextCode | 1 | Next step directive. Set to 1 to stop further action when actionCode = 0 . |
memberCallbackList | array | Callback list for members joining the group. |
memberCallbackList.userID | string | User ID of the member. |
memberCallbackList.nickname | string | Nickname of the member. |
memberCallbackList.faceURL | string | URL for the member's profile picture. |
memberCallbackList.roleLevel | int32 | Role level of the member. |
memberCallbackList.muteEndTime | int64 | Mute end time for the member. |
memberCallbackList.ex | string | Additional information for the member. |