Callback Before Setting Group Information
Description
The App backend can use this callback to intervene before setting group information. This enables the backend to review or modify the request before actually modifying group information.
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 user requests to modify group information through the App client.
- An App administrator changes group information via the REST API.
Timing of Callback
- After OpenIMServer receives the request to set group information, but before processing it.
Interface Description
Example Request URL
The CallbackCommand
here is: callbackBeforeSetGroupInfoExCommand
{WEBHOOK_ADDRESS}/callbackBeforeSetGroupInfoExCommand?contenttype=json
Example Request Package
{
"callbackCommand": "callbackBeforeSetGroupInfoExCommand",
"operationID": "1646445464564",
"groupID": "G002",
"groupName": {
"value": "NewGroupName"
},
"notification": {
"value": "Updated group notification"
},
"introduction": {
"value": "Updated group introduction"
},
"faceURL": {
"value": "http://example.com/new/path/to/face/image.png"
},
"ex": {
"value": "Updated extra data"
},
"needVerification": {
"value": 0
},
"lookMemberInfo": {
"value": 1
},
"applyMemberFriend": {
"value": 0
}
}
Request Package Field Descriptions
Field | Type | Description |
---|---|---|
callbackCommand | string | Callback command; here for pre-setting group information |
operationID | string | For global traceability; suggested to use a timestamp, unique per request |
groupID | string | Unique identifier of the group |
groupName | StringValue | Group name |
notification | StringValue | Group notification information |
introduction | StringValue | Group introduction |
faceURL | StringValue | URL of the group’s icon |
ex | StringValue | Additional data field |
needVerification | Int32Value | Whether verification is required to join the group |
lookMemberInfo | Int32Value | Whether group members’ info is visible |
applyMemberFriend | Int32Value | Whether members can request to add friends |
Example Response Package
Allow Modification
Permits modification of the group information.
{
"actionCode": 0,
"errCode": 0,
"errMsg": "",
"errDlt": "",
"nextCode": "nextCodeValue",
"groupInfoForSet": {
"groupID": "G002",
"groupName": {
"value": "NewGroupName"
},
"notification": {
"value": "Updated group notification"
},
"introduction": {
"value": "Updated group introduction"
},
"faceURL": {
"value": "http://example.com/new/path/to/face/image.png"
},
"ex": {
"value": "Updated extra data"
},
"needVerification": {
"value": 0
},
"lookMemberInfo": {
"value": 1
},
"applyMemberFriend": {
"value": 0
}
}
}
Response Package Field Descriptions
Field | Type | Description |
---|---|---|
actionCode | 0 | Indicates whether the callback was successful. 0 means success. |
errCode | 5001 | Custom error code; range 5000-9999. Set when actionCode ≠ 0; set when nextCode = 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 . |
groupID | string | Unique identifier of the group |
groupName | StringValue | Group name |
notification | StringValue | Group notification information |
introduction | StringValue | Group introduction |
faceURL | StringValue | URL of the group’s icon |
ex | StringValue | Additional data field |
needVerification | Int32Value | Whether verification is required to join the group |
lookMemberInfo | Int32Value | Whether group members’ info is visible |
applyMemberFriend | Int32Value | Whether members can request to add friends |