Skip to main content

Callback After Modifying Group Information EX

Function Description

The App business server can use this callback to real-time view changes in group information, including: notifying the App backend about member joining and real-time recording of changes in group information (such as logging or syncing with other systems).

Precautions

  • To enable the callback, you must configure the callback URL and activate the switch corresponding to this callback protocol. See the Callback Description document for configuration methods.
  • The direction of the callback is an HTTP/HTTPS POST request initiated by OpenIM Server to the App backend.
  • The App business server needs to verify whether the command parameter in the request URL is its own SDKNAME parameter after receiving the callback request.
  • The APP business server is required to respond to this request within the timeout period.

Scenarios That May Trigger This Callback

  • App users request to modify group information through the client.
  • App administrators change group information through the REST API.

Timing of the Callback

  • After OpenIM Server completes the operation to modify group information.

Interface Description

Request URL Example

In the following example, the configured callback URL of the App is https://callbackurl.

https://callbackurl?command=$CallbackCommand&contenttype=json

Request Parameter Description

ParameterDescription
httpsRequest protocol is HTTPS, request method is POST.
https://callbackurlCallback URL
CallbackCommandFixed value: callbackAfterSetGroupInfoEXCommand
contenttypeFixed value: JSON
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringoperationID used for global tracing

Request Packet Example

{
"callbackCommand": "callbackAfterSetGroupInfoEXCommand",
"groupInfoForSet": {
"groupID": "G002",
"groupName": "NewGroupName",
"notification": "Updated group notification",
"introduction": "Updated group introduction",
"faceURL": "http://example.com/new/path/to/face/image.png",
"ex": {
"value": "Updated extra data"
},
"needVerification": {
"value": 0
},
"lookMemberInfo": {
"value": 1
},
"applyMemberFriend": {
"value": 0
}
}
}

Request Packet Field Description

FieldTypeDescription
callbackCommandstringCallback command, here for setting group information after changes.
groupInfoForSetobjectObject containing set group information
groupIDstringUnique identifier of the group
groupNamestringName of the group
notificationStringValueNotification message of the group
introductionStringValueIntroduction of the group
faceURLStringValueURL of the group's icon
exStringValueAdditional data field
needVerificationInt32ValueWhether verification is needed to join the group
lookMemberInfoInt32ValueWhether group member information can be viewed
applyMemberFriendInt32ValueWhether group members can apply to be friends

Response Packet Example

Completion of Operation

Confirming the completion of the group information modification operation.

{
"actionCode": 0,
"errCode": 0,
"errMsg": "Success",
"errDlt": "",
"nextCode": "nextCodeValue"
}

Response Packet Field Description

FieldValueDescription
actionCode0Indicates whether the business system's callback was executed correctly. 0 means the operation was successful.
errCode0Represents a custom error code, here 0 indicates ignoring the callback result.
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 refuse to continue execution, set when actionCode is 0.