logo
In-app Chat
On this page

Clear the unread message count of a conversation


Overview

This API can clear the unread message count for a specified conversation of a specified user.

Note
This API is applicable to the user's latest 1000 conversations by default. If you need to apply it to earlier conversations, please contact ZEGOCLOUD technical support.

The client will receive unread count changes of conversations through the callback interface of the ZIM SDK.

iOSAndroidmacOSWindows
conversationChangedonConversationChangedconversationChangedonConversationChanged
WebU3DFlutterReact Native
conversationChangedonConversationChangedonConversationChangedconversationChanged

Request method and endpoint

  • Request method: GET
  • Request endpoint: https://zim-api.zego.im/?Action=ClearConversationUnread
  • Protocol: HTTPS
  • Rate limit: 20 times/second

Request parameters

The following list only shows the request parameters for this interface and some public parameters. For a complete list of public parameters, please refer to Accessing Server APIs - Public parameters.

ParameterTypeRequiredDescription
FromUserIdStringYesTarget user ID (registered). This API clears the unread message count for a conversation of the user.
ConvIdStringYesThe target conversation ID.
ConvTypeNumberYesConversation type:
  • 0: One-on-one chat.
  • 2: Group chat.
Note

FromUserId only supports numbers, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', '{', '}', '|', '~'.

Sample request

Untitled
https://zim-api.zego.im/?Action=ClearConversationUnread
&FromUserId=user1
&ConvId=user2
&ConvType=0
&<Common request parameters>
1
Copied!

Response parameters

ParameterTypeDescription
CodeNumberReturn code.
MessageStringDescription of the request result.
RequestIdStringRequest ID.

Sample response

Untitled
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782"
}
1
Copied!

Return codes

The following list only shows the return codes related to the business logic of the interface. For a complete list of return codes, please refer to Return codes.

Return CodeDescriptionSolution
660800002The conversation does not exist, or the conversation is not applicable to this interface (it is not among the latest 1,000 conversations).Please confirm whether the conversation ID is correct.

Previous

Set conversation marks

Next

Obtain a license