Recalling Group Messages

Last updated: 2020-03-12 12:13:09

PDF

Feature Description

The app admin uses this API to recall the messages of a specified group. In this case, the messages must be within the roaming validity period.

API Calling Description

Applicable group types

Group Type Support Recalling Group Messages
Private Yes
Public Yes
ChatRoom Yes
AVChatRoom No
BChatRoom No

Instant Messaging (IM) provides the preceding five built-in group types. For details, see Group Systems.

Request URL example

https://console.tim.qq.com/v4/group_open_http_svc/group_msg_recall?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

Request parameters

The following table lists only the parameters to be modified when this API is called. For details on other parameters, see RESTful API Overview.

Parameter Description
v4/group_open_http_svc/group_msg_recall The request API.
sdkappid The SDKAppID assigned by the IM console when an app is created.
identifier This must be the app admin account. For details, see App Admins.
usersig The signature generated by the app admin account. For details, see Generating UserSig.
random Enter a random 32-bit unsigned integer ranging from 0 to 4294967295.

Maximum calling frequency

The maximum calling frequency is 200 times per second.

Request packet example

Recalled messages cannot be restored. Therefore, use this API with caution.

{
    "GroupId": "@TGS#2J4SZEAEL",
    "MsgSeqList":[
        {
            "MsgSeq":100
        },
        {
            "MsgSeq":101
        }
    ]
}

Request packet fields

Field Type Attribute Description
GroupId String Required The ID of the target group.
MsgSeqList Array Required The sequence number list of recalled messages. A single request can recall up to 10 messages.
MsgSeq Integer Required The sequence number of the message to be recalled by the request.

Response packet example

{
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0,
    "RecallRetList":[
        {
            "MsgSeq":100,
            "RetCode":10030
        },
        {
            "MsgSeq":101,
            "RetCode": 0
        }
    ]
}

Response packet fields

Field Type Description
ActionStatus String The request processing result. OK: succeeded. FAIL: failed.
ErrorCode Integer The error code. 0: succeeded. Others: failed.
ErrorInfo String Error information.
RecallRetList Array The detailed result of the message recall request.
MsgSeq String The sequence number of a single recalled message.
RetCode String The result of recalling a single message. 0: succeeded. Others: failed. For details, see the description of error codes below.

Error Codes

Unless a network error (such as error 502) occurs, the HTTP return code for this API is always 200. ErrorCode and ErrorInfo in the response packet represent the actual error code and error information, respectively.
For common error codes (60000 to 79999), see Error Codes.
The following table describes the error codes specific to this API.

Error Code Description
10002 An internal server error occurred. To correct it, try again.
10003 The request command word is invalid.
10004 A parameter is invalid. To correct it, check whether request parameters are correct based on the error description.
10007 Operation permissions are insufficient. For example, a common member in a public group attempts to remove a member from the group, but only the app admin has the permission to do so.
10010 The group does not exist or has been dismissed.
10015 The group ID is invalid. To correct it, check whether the group ID is correct.
10030 The message to be recalled does not exist.
10031 The message to be recalled has exceeded the time limit.
10032 The message to be recalled does not support recalling.
10033 The group type does not support recalling.
10041 The configuration of the app (SDKAppID) does not support recalling group messages.

API Commissioning Tool

Use the online commissioning tool for RESTful APIs to commission this API.

References

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