Skip to main content

Callback After Sending Group Message

Functional Description

After a successful operation, the business server can perform necessary data synchronization or other business logic processing through this callback.

Precautions

  • To enable the callback, you must configure the callback URL and turn on the switch corresponding to this callback protocol. See the Callback Description document for configuration methods.
  • The callback direction is an HTTP/HTTPS POST request initiated by IMServer to the business server.
  • The business server must respond to this request within the timeout period.

Scenarios That May Trigger This Callback

  • After users perform corresponding operations successfully through the client or APP administrators through REST API.

Timing of Callback

  • After a group chat message is successfully sent.

Interface Description

Request URL Example

Here CallbackCommand is: callbackAfterSendGroupMsgCommand

{WEBHOOK_ADDRESS}/callbackAfterSendGroupMsgCommand?contenttype=json

Request Package Example

{
"sendID": "sender123",
"callbackCommand": "callbackAfterSendGroupMsgCommand",
"serverMsgID": "serverMsg123",
"clientMsgID": "clientMsg123",
"operationID": "1646445464564",
"senderPlatformID": 1,
"senderNickname": "JohnDoe",
"sessionType": 2,
"msgFrom": 1,
"contentType": 1,
"status": 1,
"sendTime": 1673048592000,
"createTime": 1673048592000,
"content": "Hello, this is a group message!",
"seq": 1,
"atUserList": ["user456", "user789"],
"faceURL": "http://example.com/path/to/sender/face/image.png",
"ex": "Extra data",
"groupID": "group123"
}

Request Package Field Description

ObjectTypeDescription
sendIDstringUnique identifier of the sender
callbackCommandstringCallback command, here it is the callback after sending a group message
serverMsgIDstringMessage ID generated by the server
clientMsgIDstringMessage ID generated by the client
operationIDstringUnique identifier for the operation
senderPlatformIDint32Platform ID of the sender
senderNicknamestringNickname of the sender
sessionTypeint32Session type
msgFromint32Message source
contentTypeint32Type of message content
statusint32Message status
sendTimeint64Timestamp of message sending (milliseconds)
createTimeint64Timestamp of message creation (milliseconds)
contentstringMessage content
sequint32Sequence number of the message
atUserListarrayList of group member IDs
senderFaceURLstringAvatar URL of the sender
exstringExtra data field
groupIDstringUnique identifier of the group

Response Package Example

Successful Response

After the App business server synchronizes data, it sends a callback response package

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

Response Package Field Description

FieldValueDescription
actionCode0Indicates whether the business system callback was executed correctly. 0 means the operation was successful.
errCode0Custom error code, 0 here 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 execution instruction, 1 means refusing to continue execution, set when actionCode is 0.