Skip to main content

Callback for Kicking Out Group Members

Function Description

The App business server can use this callback to handle requests from group administrators to kick out members, including real-time recording of members leaving the group (such as logging or synchronizing 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

  • Group administrators or owners attempt to kick out one or more group members through the client.

Timing of the Callback

  • After OpenIM Server receives a request to kick out group members and before processing the request.

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: kickGroupMemberCommand
contenttypeFixed value: JSON
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringoperationID used for global tracing

Request Packet Example

{
"callbackCommand": "kickGroupMemberCommand",
"groupID": "G001",
"kickedUserIDs": ["user123", "user456"],
"reason": "Violation of group rules"
}

Request Packet Field Description

FieldTypeDescription
callbackCommandstringCallback command, here for kicking out group members.
groupIDstringUnique identifier of the group.
kickedUserIDs[]stringList of user IDs of the members being kicked out.
reasonstringReason for kicking out members.

Response Packet Example

Allowing the Kick Out

Allowing the specified group members to be kicked out.

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