tencent cloud


Recalling Group Messages

Last updated: 2022-08-22 15:36:50

    Feature Description

    This API is used by app admins to recall messages of a specified group. The messages must be within the roaming validity period.

    API Calling Description

    Applicable group types

    Group Type ID Is Recalling Group Messages Supported?
    Private Yes. Same as Work (work group for friends) in the new version.
    Public Yes.
    ChatRoom Yes. Same as Meeting (temporary meeting group) in the new version.
    AVChatRoom No.
    Community Yes.

    These are the 4 built-in group types in IM. For detailed information, see the Group System.

    Sample request URL


    Request parameters

    The list below contains only the parameters commonly used when calling this API and their descriptions. For more parameters, see RESTful API Overview.

    Parameter Description
    https The request protocol is HTTPS, and the request method is POST.
    xxxxxx The country/region where your SDKAppID is located.
  • China: console.tim.qq.com
  • Singapore: adminapisgp.im.qcloud.com
  • Seoul: adminapikr.im.qcloud.com
  • Frankfurt: adminapiger.im.qcloud.com
  • India: adminapiind.im.qcloud.com
  • v4/group_open_http_svc/group_msg_recall Request API
    sdkappid SDKAppID assigned by the IM console when the application is created
    identifier The value must be the app admin account. For more information, see App Admins.
    usersig Signature generated by the app admin account. For details, see Generating UserSig.
    random A random 32-bit unsigned integer ranging from 0 to 4294967295
    contenttype Request format. The value is always json.

    Maximum calling frequency

    The maximum calling frequency is 200 calls per second.

    Sample request packet

    Messages that have been recalled cannot be restored. Therefore, use this API with caution.

       "GroupId": "@TGS#2J4SZEAEL",

    Request packet fields

    Field Type Property Description
    GroupId String Required ID of the target group
    MsgSeqList Array Required List of the sequence numbers of messages to be recalled. A single request can recall up to 10 messages.
    MsgSeq Integer Required Sequence number of the message to be recalled by the request
    TopicId String Optional The ID of the topic. This option is only avaiable for the community that supports the topic feature.

    Sample response packet body

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

    Response packet fields

    Field Type Description
    ActionStatus String Result of the request. OK indicates that the request was successful, and FAIL indicates that the request failed.
    ErrorCode Integer Error code. 0 indicates that the request was successful, and any non-zero value indicates that the request failed.
    ErrorInfo String Detailed error information
    RecallRetList Array Detailed result of the message recall request
    MsgSeq Integer Sequence number of the single recalled message
    RetCode Integer Recall result of the single message. 0: successful. Others: failed. For details, see the description of error codes below.

    Error Codes

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

    Error Code Description
    10002 An internal server error occurred. Please try again.
    10003 The request command word is invalid.
    10004 A parameter is invalid. Check the error description and troubleshoot the issue.
    10007 The operator does not have sufficient permissions for this operation. The operator must have the necessary role in the group to perform this operation.
    10010 The group does not exist, or once existed but has been disbanded.
    10015 The group ID is invalid. Be sure to use the correct group ID.
    10030 The message to be recalled does not exist.
    10031 The message to be recalled has passed the time limit.
    10032 The message to be recalled does not support the recall operation.
    10033 The group type does not support the recall operation.
    10041 This app (SDKAppID) has been configured to prohibit recalling group messages.

    API Debugging Tool

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


    Sending system messages in a group (v4/group_open_http_svc/send_group_system_notification)

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support