Callback Before Group Members Join
Function Description
The app's backend can use this callback to monitor information about group members joining in real-time, including intercepting user details such as avatar, nickname, user permissions, and additional information before they join the group.
Precautions
- To enable this callback, you must configure the callback URL and activate the corresponding callback protocol switch. For configuration details, see the Callback Documentation.
- The callback direction is from OpenIM Server to the app's backend via HTTP/HTTPS POST requests.
- The app's backend must respond to this request within the timeout period.
Scenarios That May Trigger This Callback
- The app's group owner initiates a group creation via the client.
- The app administrator invites users to the group via REST API.
- The app administrator handles group application responses via REST API.
- The app user joins the group.
Callback Timing
- The callback occurs before OpenIM Server prepares to create a group chat.
- The callback occurs before OpenIM Server prepares to approve a user joining the group.
Interface Description
Example Request URL
The example below shows the callback URL configured for the app as http://www.example.com/callbackCommand?contenttype=json
.
http://www.example.com/CallbackBeforeMembersJoinGroupCommand?contenttype=json
Request Parameters Description
Parameter | Description |
---|---|
http | Request protocol is HTTP, and the request method is POST |
www.example.com | Domain or hostname in the callback.url field of configy.yaml |
CallbackCommand | This is: CallbackBeforeMembersJoinGroupCommand |
contenttype | Fixed value: JSON |
Header
Header Name | Example Value | Required | Type | Description |
---|---|---|---|---|
operationID | 1646445464564 | Required | string | operationID for global link tracking |
Request Payload Example
{
"callbackCommand": "CallbackBeforeMembersJoinGroupCommand",
"groupID": "12345",
"memberList": [
{
"userID": "666",
"ex": "337845818, 3q"
},
{
"userID": "1028",
"ex": "Are U OK"
}
],
"groupEx": "test Group"
}
Request Payload Fields Description
Object | Type | Description |
---|---|---|
callbackCommand | string | Callback command, here it is the callback before members join. |
groupID | string | Unique identifier for the group. |
memberList | array | List of information about members joining, including user ID and additional info. |
memberList.userID | string | User ID of the member |
memberList.ex | string | Additional information of the member |
groupEx | string | Additional information about the group |
Response Payload Example
{
"actionCode": 0,
"errCode": 0,
"errMsg": "Success",
"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 Payload Fields Description
Field | Value | Description |
---|---|---|
actionCode | 0 | Indicates whether the callback was executed successfully. 0 indicates success. |
errCode | 5001 | Custom error code, range from 5000-9999. Set when actionCode is not 0 or nextCode is 1 . |
errMsg | "An error message" | Simple error message corresponding to the custom error code. |
errDlt | "Detailed error information" | Detailed error information corresponding to the custom error code. |
nextCode | 1 | Next execution instruction. Set when actionCode is 0 . 1 indicates to reject the continuation. |
memberCallbackList | array | List of callback data after webhook processing |
memberCallbackList.userID | string | User ID |
memberCallbackList.nickname | string | User nickname |
memberCallbackList.faceURL | string | User avatar URL |
memberCallbackList.roleLevel | int32 | User permission level |
memberCallbackList.muteEndTime | int64 | User mute end time |
memberCallbackList.ex | string | User additional information |