Marking One-to-One Messages as Read

Last updated: 2021-01-27 12:29:04

    Feature Description

    This API is used to mark all the messages of a one-to-one conversation as read.

    API Call Description

    Sample request URL

    Request parameters

    The following table only describes the modified parameters when this API is called. For more information on other parameters, please see RESTful API Overview.

    Parameter Description
    v4/openim/admin_set_msg_read Request API.
    sdkappid The SDKAppID assigned by the IM console when an application is created.
    identifier The app administration account.
    usersig The signature generated by the app administrator account. For more information on how to generate the signature, please see Generating UserSig.
    random A random 32-bit unsigned integer.

    Maximum call frequency

    100 calls per second. To increase the call frequency, please submit a ticket to us based on the ticket template.

    Sample request packet

    The administrator specifies that dramon1 marks all the messages of its one-to-one conversation with dramon2 as read.


    Request packet fields

    Field Type Required Description
    Report_Account String Yes UserId of the account for which to mark messages as read.
    Peer_Account String Yes UserId of the other account in the one-to-one conversation.

    Sample response packet

        "ActionStatus": "OK",
        "ErrorInfo": "",
        "ErrorCode": 0

    Response packet fields

    Field Type Description
    ActionStatus String Request result. OK: successful. FAIL: failed.
    ErrorInfo String Error information.
    ErrorCode Number Error code.

    Error Codes

    The returned HTTP status code for this API is always 200 unless a network error (such as error 502) occurs. The specific error code and details can be found in the response fields ErrorCode and ErrorInfo respectively.
    For public error codes (60000 to 79999), please see Error Codes.
    The following table describes the error codes specific to this API:

    Error Code Description
    90001 Failed to parse the JSON request packet. Make sure the format of the request is valid.
    90003 The To_Account field is missing in the JSON request packet or the account it specifies does not exist.
    90008 The From_Account field is missing in the JSON request packet or the account it specifies does not exist.

    API Debugging Tool

    Use the RESTful API online debugging tool to debug this API.