Skip to main content

Callback After Sending Group Message

Description

The App business server can use this callback to view group messages sent by users in real-time. This includes:

  • Notifying the App backend of successfully sent group messages.
  • Allowing the App to synchronize necessary data.

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 sends a group message via the App client.
  • An App administrator sends a group message through the REST API.

Timing of Callback

  • After the group message is successfully sent.

Interface Description

Example Request URL

The CallbackCommand here is: callbackAfterSendGroupMsgCommand

{WEBHOOK_ADDRESS}/callbackAfterSendGroupMsgCommand?contenttype=json

Example Request Package

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

FieldTypeDescription
sendIDstringUnique identifier of the sender
callbackCommandstringCallback command for post-group message send
serverMsgIDstringMessage ID generated by the server
clientMsgIDstringMessage ID generated by the client
operationIDstringUnique identifier of the operation
senderPlatformIDint32Platform ID of the sender
senderNicknamestringNickname of the sender
sessionTypeint32Type of session
msgFromint32Source of the message
contentTypeint32Type of the message content
statusint32Status of the message
sendTimeint64Timestamp of when the message was sent (ms)
createTimeint64Timestamp of when the message was created (ms)
contentstringContent of the message
sequint32Sequence number of the message
atUserListarrayList of group member IDs
faceURLstringURL of the sender's profile picture
exstringAdditional data field
groupIDstringUnique identifier of the group

Example Response Package

Success Response

After synchronizing data, the App business server sends a response package.

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

Response Package Field Descriptions

FieldValueDescription
actionCode0Indicates whether the callback executed successfully. 0 means success.
errCode0Custom error code; 0 here indicates the callback result is ignored.
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 directive. Set to 1 to stop further action when actionCode = 0.