Skip to main content

Callback After Setting Group Member Information

Function Description

The App business server can use this callback to obtain requests for setting group member information, allowing the App to perform necessary data synchronization.

Precautions

  • To enable the callback, it is required to configure the callback URL and turn on the switch corresponding to this callback protocol. For configuration methods, see the Callback Explanation document.
  • The callback is an HTTP/HTTPS POST request initiated by OpenIM Server to the App backend.
  • After receiving the callback request, the App business server must verify whether the command parameter in the request URL matches its SDKNAME parameter.
  • The APP business server must respond to this request within the timeout period.

Scenarios That May Trigger This Callback

  • Group administrators successfully modify group member-related information through the client.

Timing of the Callback

  • After OpenIM Server updates group member information.

Interface Description

Request URL Example

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

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

Request Parameter Description

ParameterDescription
httpsRequest protocol is HTTPS, method is POST
https://callbackurlCallback URL
CallbackCommandFixed value: callbackAfterSetGroupMemberInfoCommand
contenttypeFixed value: JSON
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringoperationID for global link tracking

Request Packet Example

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

Request Packet Field Explanation

FieldTypeDescription
callbackCommandstringCallback command, here for the callback after setting group member info
groupIDstringUnique identifier of the group
userIDstringID of the user joining the group
nickNamestringNickname of the user joining the group
faceURLstringURL of the group member's icon
roleLevelstringRole level of the user in the group. Normal member (20) or administrator (60)
exstringAdditional data field

Response Packet Example

After synchronizing data, the App backend sends a callback response packet.

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

Response Packet Field Explanation

FieldValueDescription
actionCode0Indicates whether the business system's callback is executed correctly. 0 means the operation is successful.
errCode0Indicates a custom error code, here 0 means ignore 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 step instruction, 1 means refuse to continue executing, set when actionCode is 0.