Skip to content

删除消息表情回复

删除指定消息的某一表情回复。

前提条件

  • 应用需要开启机器人能力
  • 调用当前接口的机器人或者用户,需要在待删除表情回复的消息所属的会话内。

使用限制

  • 已被撤回的消息无法添加表情回复。
  • 调用当前接口的机器人或者用户,只能删除由自己添加的表情回复,且需要保证该表情回复真实存在于消息中。

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/im/v1/messages/:message_id/reactions/:reaction_id
HTTP MethodDELETE
接口频率限制1000 次/分钟、50 次/秒
支持的应用类型custom,isv
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可im:message 获取与发送单聊、群组消息 im:message.reactions:write_only 发送、删除消息表情回复

请求头

名称类型必填描述
Authorizationstringtenant_access_tokenuser_access_token 值格式:"Bearer access_token" 示例值:"Bearer u-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token

路径参数

名称类型描述
message_idstring待删除表情回复的消息 ID。ID 获取方式: - 调用发送消息接口后,从响应结果的 message_id 参数获取。 - 监听接收消息事件,当触发该事件后可以从事件体内获取消息的 message_id。 - 调用获取会话历史消息接口,从响应结果的 message_id 参数获取。
示例值:"om_8964d1b4*********2b31383276113"
reaction_idstring待删除的表情回复 ID,该 ID 获取方式:
- 调用添加消息表情回复接口添加表情回复后,在返回结果中获取。
- 调用获取消息表情回复接口,获取某一表情回复的 ID。
示例值:"ZCaCIjUBVVWSrm5L-3ZTw*************sNa8dHVplEzzSfJVUVLMLcS_"

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
datamessage.reaction-
  └ reaction_idstring表情回复 ID。
  └ operatoroperator添加表情回复的操作人。
    └ operator_idstring操作人 ID,具体的取值与 operator_type 相关: - 当 operator_type 取值 app 时返回机器人的应用 ID(app_id)。 - 当 operator_type 取值 user 时返回用户的 open_id。
    └ operator_typestring操作人身份。
可选值有
- app: 应用 - user: 用户
  └ action_timestring添加消息表情回复的时间。Unix 时间戳,单位:ms
  └ reaction_typeemoji表情类型
    └ emoji_typestringemoji 类型。emoji_type 值对应的表情参考表情文案说明

响应体示例

json
{
    "code": 0,
    "msg": "success",
    "data": {
        "reaction_id": "ZCaCIjUBVVWSrm5L-3ZTw****",
        "operator": {
            "operator_id": "ou_ff0b7ba35fb****",
            "operator_type": "user"
        },
        "action_time": "1626086391570",
        "reaction_type": {
            "emoji_type": "SMILE"
        }
    }

错误码

HTTP状态码错误码描述排查建议
400230110Action unavailable as the message has been deleted.消息被删除,无法进行操作。
400231001reaction type is invalid.要操作的表情回复不归属于当前租户,无法删除。
400231002The operator has no permission to react on the specific message.当前调用接口的机器人或用户,没有权限对目标消息添加或删除表情回复。通常是因为机器人或用户不在消息所属的会话内。
400231003The message is not found, maybe not exist or deleted.找不到目标消息,可能因为传入的消息 ID 有误或者消息已经被撤回。
400231004The chat in which the message exists is not found, maybe not exist, deleted or archived.目标消息所属会话不存在、已被解散或归档等,无法进行操作。
400231005The thread has been no-trace removed, cannot put reaction.目标消息是一个话题消息,该话题消息被无痕撤回,无法进行操作。
400231007The operator has no permission to delete this reaction.当前操作者没有权限删除某个表情回复。原因为表情回复的原始添加人不是当前操作者。
400231008The operator has no access to the message.操作人对该消息没有访问权限,通常是因为操作人不在消息所在会话内。
400231010The reaction does not belong to the message.待删除的表情回复不属于指定的消息,请检查 reaction_id 和 message_id 是否匹配。
400231011The request has an invalid reaction_id.reaction_id 参数不合法,无法定位到真实存在的表情回复。请获取并传入正确的 reaction_id 后重试。
400231012The request has an invalid pageToken.page_token 参数不合法。请根据 page_token 参数描述,设置正确的值。
400231013The request has an invalid AuthType.请求的授权方式不合法。没有使用 tenant_access_token 或者 user_access_token 进行授权。
400231015Act on reaction failed, repeated request is processing.重复的表情回复请求正在处理中。
400231018The message is invisible to the operator.该消息对于操作者不可见,无法进行本操作。
400231019Due to the settings of this user, you are temporarily unable to perform this operation.由于目标用户(消息发送者)的设置(例如屏蔽消息),暂时无法执行此操作。
400231020Due to the configuration of the tenant administrator, you cannot perform this operation on the target user temporarily.由于租户管理员的配置,暂时无法对目标用户(消息发送者)执行此操作,请联系租户管理员协助排查。
400231021No permission to operate external chats.没有权限操作外部群。
400231022Bot has NO availability to this user.单聊用户(以群聊的 chat_id 指定的消息接收者,但 chat_id 对应的群聊类型为单聊 p2p)不在应用机器人的可用范围内,或者是在应用的禁用范围内。 解决方案: 1. 登录开发者后台,找到并进入指定应用详情页。 2. 在左侧导航栏进入 应用发布 > 版本管理与发布 页面,点击 创建版本。 3. 在 版本详情 页面,找到 可用范围 区域,点击 编辑。 4. 在弹出的对话框内,配置应用的可用范围,将用户添加至可用范围内。 5. 在页面底部点击 保存,并发布应用使配置生效。 6. (可选)如果以上配置完成后仍报错,则需要联系企业管理员登录管理后台,在 工作台 > 应用管理 中进入指定应用详情页,在 应用可用范围 内查看该用户是否被设置为了 禁用成员。 具体操作参见配置应用可用范围
400232009Your request specifies a chat which has already been dissolved.群组已被解散,无法执行操作。

更多错误码信息,参见通用错误码

内容来源:飞书开放平台 · 自动爬取整理