Skip to main content

Callback Before Member Joins Group

Functional Description

Before a user joins a group by any means, the business server can reject this request, or modify and intervene in the request.

Precautions

  • To enable the callback, you must configure the callback URL and turn on the switch corresponding to this callback protocol. See the Callback Description document for configuration methods.
  • The callback direction is an HTTP/HTTPS POST request initiated by IMServer to the business server.
  • The business server must respond to this request within the timeout period.

Scenarios That May Trigger This Callback

  • Before users perform corresponding operations through the client or APP administrators through REST API, intended to make users join the group.

Timing of Callback

  • Before a group member joins the group by any means.

Interface Description

Request URL Example

Here CallbackCommand is: callbackBeforeMembersJoinGroupCommand

{WEBHOOK_ADDRESS}/callbackBeforeMembersJoinGroupCommand?contenttype=json

Request Package Example

{
"callbackCommand": "callbackBeforeMembersJoinGroupCommand",
"groupID": "12345",
"memberList": [
{
"userID": "666",
"ex": "337845818, 3q"
},
{
"userID": "1028",
"ex": "Are U OK"
}
],
"groupEx": "test Group"
}

Request Package Field Description

ObjectTypeDescription
callbackCommandstringCallback command, here it is the callback before members join the group.
groupIDstringUnique identifier of the group.
memberListarrayList of info of members about to join the group, including userID and user extra info ex.
memberList.userIDstringUser ID of the member
memberList.exstringUser extra info of the member
groupExstringExtra info of the group.

Response Package Example

{
"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 Description

FieldValueDescription
actionCode0Indicates whether the business system callback was executed correctly. 0 means the operation was successful.
errCode5001Custom error code, ranges from 5000-9999. Set when actionCode is not 0; set when 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, 1 means refusing to continue execution, set when actionCode is 0.
memberCallbackListarrayList of Callback after webhook
memberCallbackList.userIDstringUser ID
memberCallbackList.nicknamestringUser nickname
memberCallbackList.faceURLstringUser avatar URL
memberCallbackList.roleLevelint32User permission level
memberCallbackList.muteEndTimeint64User mute end time
memberCallbackList.exstringUser extra info