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
Field | Type | Description |
---|---|---|
sendID | string | Unique identifier of the sender |
callbackCommand | string | Callback command for post-group message send |
serverMsgID | string | Message ID generated by the server |
clientMsgID | string | Message ID generated by the client |
operationID | string | Unique identifier of the operation |
senderPlatformID | int32 | Platform ID of the sender |
senderNickname | string | Nickname of the sender |
sessionType | int32 | Type of session |
msgFrom | int32 | Source of the message |
contentType | int32 | Type of the message content |
status | int32 | Status of the message |
sendTime | int64 | Timestamp of when the message was sent (ms) |
createTime | int64 | Timestamp of when the message was created (ms) |
content | string | Content of the message |
seq | uint32 | Sequence number of the message |
atUserList | array | List of group member IDs |
faceURL | string | URL of the sender's profile picture |
ex | string | Additional data field |
groupID | string | Unique 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
Field | Value | Description |
---|---|---|
actionCode | 0 | Indicates whether the callback executed successfully. 0 means success. |
errCode | 0 | Custom 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. |
nextCode | 1 | Next execution directive. Set to 1 to stop further action when actionCode = 0 . |