Skip to main content

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

ParameterDescription
httpRequest protocol is HTTP, and the request method is POST
www.example.comDomain or hostname in the callback.url field of configy.yaml
CallbackCommandThis is: CallbackBeforeMembersJoinGroupCommand
contenttypeFixed value: JSON
Header NameExample ValueRequiredTypeDescription
operationID1646445464564RequiredstringoperationID 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

ObjectTypeDescription
callbackCommandstringCallback command, here it is the callback before members join.
groupIDstringUnique identifier for the group.
memberListarrayList of information about members joining, including user ID and additional info.
memberList.userIDstringUser ID of the member
memberList.exstringAdditional information of the member
groupExstringAdditional 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

FieldValueDescription
actionCode0Indicates whether the callback was executed successfully. 0 indicates success.
errCode5001Custom 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.
nextCode1Next execution instruction. Set when actionCode is 0. 1 indicates to reject the continuation.
memberCallbackListarrayList of callback data after webhook processing
memberCallbackList.userIDstringUser ID
memberCallbackList.nicknamestringUser nickname
memberCallbackList.faceURLstringUser avatar URL
memberCallbackList.roleLevelint32User permission level
memberCallbackList.muteEndTimeint64User mute end time
memberCallbackList.exstringUser additional information