tencent cloud

Chat

Callback After C2C Message Editing

Download
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-07-10 15:17:53

Overview

The App backend uses this webhook to monitor real-time edits to C2C messages.

Notes

To enable this webhook, configure the webhook URL and activate the corresponding switch. For detailed instructions, see the Third-Party Webhook Configuration documentation.
The webhook is triggered by the Chat backend and sent to the App backend via HTTPS POST.
Upon receiving a webhook request, the App backend must verify that the SDKAppID parameter in the request URL matches its own SDKAppID.
For additional security considerations, refer to Third-Party Webhook Overview: Security Considerations.

Scenarios That May Trigger This Webhook

App users edit C2C messages through the client.
App administrators mark C2C messages as read using the REST API Modify C2C Message History.

Webhook Trigger Timing

The webhook is triggered after a C2C message has been successfully modified.

API Description

Request URL Example

In this example, the webhook URL configured by the App is https://www.example.com.
Example:
https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json&ClientIP=$ClientIP&OptPlatform=$OptPlatform

Query Parameters

Parameter
Description
https
Request protocol is HTTPS; request method is POST
www.example.com
Webhook URL
SdkAppid
SDKAppID assigned when creating the application in the Chat console
CallbackCommand
Fixed value: C2C.CallbackAfterModifyMsg
contenttype
Request body is always JSON
ClientIP
Client IP address, e.g., 127.0.0.1
OptPlatform
Client platform. For values, see OptPlatform in Third-Party Webhook Overview: Webhook Protocol

Request Example

{
"CloudCustomData": "1769772027",
"MsgBody": [
{
"MsgType": "TIMTextElem",
"MsgContent": {
"Text": "2026-01-30T11:20:26.548Z"
}
}
],
"CallbackCommand": "C2C.CallbackAfterModifyMsg",
"Operator_Account": "jared",
"From_Account": "jared",
"To_Account": "Jonh",
"MsgRandom": 690,
"MsgSeq": 609,
"MsgTime": 1769771529,
"MsgKey": "609_690_1769771529",
"ErrorInfo": "modify msg succeed",
"EventTime": 1769772027036
}

Request Fields

Field
Type
Description
CloudCustomData
String
Custom message data. Stored in the cloud, sent to the recipient, and retrievable after app uninstall/reinstall.
MsgBody
Array
Message content. For details, see Message Format Description. A message may contain multiple elements; MsgBody is an Array.
CallbackCommand
String
Webhook command.
Operator_Account
String
UserID of the person who modified the message.
From_Account
String
UserID of the original message sender.
To_Account
String
UserID of the message recipient.
MsgRandom
Integer
Message random number (32-bit unsigned integer).
MsgSeq
Integer
Message sequence number (32-bit unsigned integer).
MsgTime
Integer
Message timestamp (UNIX time).
MsgKey
String
Unique message identifier.
ErrorInfo
String
Error information.
EventTime
Integer
Timestamp of the event in milliseconds.

Response Example

{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0 // 0 indicates webhook succeeded, 1 indicates webhook error
}

Response Fields

Field
Type
Required
Description
ActionStatus
String
Required
Result of request processing:
OK indicates success.
FAIL indicates failure.
ErrorCode
Integer
Required
Error code:
0 indicates success.
1 indicates failure.
ErrorInfo
String
Required
Error information.

References

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan