tencent cloud

Chat

DokumentasiChatServer APIsWebhooksOne-to-One Message WebhooksCallback After Clearing All Unread Messages (Including C2C and Group Chats)

Callback After Clearing All Unread Messages (Including C2C and Group Chats)

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

Overview

The App backend uses this webhook to monitor when users clear all unread messages in real time.

Notes

To enable this webhook, configure the webhook URL and turn on the corresponding switch for this webhook. For configuration instructions, see the Third-Party Webhook Configuration documentation.
The webhook is sent from the Chat backend to the App backend using an HTTPS POST request.
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.

Trigger Scenarios

The webhook is triggered when an app user clears all unread messages from the client.

Webhook Trigger Timing

The webhook is sent immediately after all unread messages are successfully cleared.

API Reference

Request URL Example

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

Query Parameters

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

Request Example

{
"CallbackCommand": "C2C.CallbackAfterMsgReadAll",
"Report_Account": "Jonh",
"EventTime": 1769773302575,
"GroupReadInfo": [
{
"GroupId": "groupid",
"MsgSeq": 100
}
]
}

Request Fields

Field
Type
Description
CallbackCommand
String
Webhook command.
Report_Account
String
UserID of the request sender.
EventTime
Integer
Event trigger timestamp in milliseconds.
GroupReadInfo
Array
List of groups whose unread messages were cleared.
GroupId
String
Group ID.
MsgSeq
Integer
Group message sequence as provided in the clear unread request.

Response Example

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

Response Fields

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

Reference

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan