Skip to main content

Callback Before Setting Group Member Information

Description

The App backend can use this callback to review the updated group member information before changes are applied. This allows the backend to review or modify the request before the information is actually updated.

Important Notes

  • To enable this callback, configure the callback URL and activate the corresponding protocol switch. For configuration details, see the Callback Introduction document.
  • The callback direction is from OpenIMServer 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

  • A group administrator modifies group member-related information through the client.

Timing of Callback

  • Before OpenIMServer updates the group member information.

Interface Description

Example Request URL

The CallbackCommand here is: callbackBeforeSetGroupMemberInfoCommand

{WEBHOOK_ADDRESS}/callbackBeforeSetGroupMemberInfoCommand?contenttype=json

Example Request Package

{
"callbackCommand": "callbackBeforeSetGroupMemberInfoCommand",
"groupID": "12345",
"userID": "user789",
"nickName": "user",
"faceURL": "http://example.com/path/to/face/image.png",
"roleLevel": 20,
"ex": "Extra data"
}

Request Package Field Descriptions

FieldTypeDescription
callbackCommandstringCallback command; here it’s the callback before setting group member info
groupIDstringUnique identifier of the group
userIDstringUser ID of the member joining the group
nickName*stringNickname of the user in the group
faceURL*stringURL of the member’s icon
roleLevel*int32User’s permission level in the group. Regular member (20) or admin (60)
ex*stringAdditional data field

Example Response Package

Allow Modification

{
"actionCode": 0,
"errCode": 0,
"errMsg": "",
"errDlt": "",
"nextCode": 0,
"ex": "Some extra data",
"nickName": "user",
"faceURL": "http://example.com/path/to/face/image.png",
"roleLevel": 20
}

Response Package Field Descriptions

FieldTypeDescription
actionCode0Indicates whether the callback was successful. 0 means success.
errCode5001Custom error code; in the range of 5000-9999. Set when actionCode is not 0 or nextCode equals 1.
errMsg"An error message"Simple error message for the custom error code
errDlt"Detailed error information"Detailed error information for the custom error code
nextCode1Next step directive; set to 1 to stop further action if actionCode = 0
ex*stringAdditional data field
nickName*stringNickname of the user in the group
faceURL*stringURL of the member’s icon
roleLevel*int32User’s permission level in the group. Regular member (20) or admin (60)