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
Field | Type | Description |
---|---|---|
callbackCommand | string | Callback command; here it’s the callback before setting group member info |
groupID | string | Unique identifier of the group |
userID | string | User ID of the member joining the group |
nickName | *string | Nickname of the user in the group |
faceURL | *string | URL of the member’s icon |
roleLevel | *int32 | User’s permission level in the group. Regular member (20) or admin (60) |
ex | *string | Additional 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
Field | Type | Description |
---|---|---|
actionCode | 0 | Indicates whether the callback was successful. 0 means success. |
errCode | 5001 | Custom 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 |
nextCode | 1 | Next step directive; set to 1 to stop further action if actionCode = 0 |
ex | *string | Additional data field |
nickName | *string | Nickname of the user in the group |
faceURL | *string | URL of the member’s icon |
roleLevel | *int32 | User’s permission level in the group. Regular member (20) or admin (60) |