更新应用发送的消息卡片
PATCH
/open-apis/im/v1/messages/{message_id}
自建应用商店应用
注意事项:
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 230001 | Your request contains an invalid request parameter. | 参数错误,请根据接口返回的错误信息并参考文档检查输入参数。 |
400 | 230006 | Bot ability is not activated. | 机器人能力未启用 。在开发者后台-应用功能-机器人页面开启机器人功能并发布上线。 |
400 | 230011 | The message is recalled. | 消息已被撤回,不支持该操作。 |
400 | 230020 | This operation triggers the frequency limit. | 当前操作触发限频,请降低请求频率。 |
400 | 230025 | The length of the message content reaches its limit. | 消息体长度超出限制。文本消息请求体最大不能超过150KB;卡片及富文本消息请求体最大不能超过30KB。 |
400 | 230027 | Lack of necessary permissions. | 请根据本文档中的权限要求部分补充所需权限。 |
400 | 230028 | The messages do NOT pass the audit. | 消息DLP审查未通过,当消息内容中含有明文电话号码、明文个人邮箱等内容时可能会触发该错误;请根据接口返回的错误信息检查消息内容。 |
400 | 230031 | Message can only be modified within 14 days after sending. | 在消息发送后的14天内才可以修改消息内容。 |
400 | 230099 | Failed to create card content. | 创建卡片失败,失败原因请查看接口报错信息。 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'https://open.feishu.cn/open-apis/im/v1/messages/om_dc13264520392913993dd051dba21dcf' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"content": "{\"config\":{\"wide_screen_mode\":true},\"elements\":[{\"alt\":{\"content\":\"\",\"tag\":\"plain_text\"},\"img_key\":\"img_7ea74629-9191-4176-998c-2e603c9c5e8g\",\"tag\":\"img\"},{\"tag\":\"div\",\"text\":{\"content\":\"更新一下?\\n你有哪些想极力推荐给他人的珍藏书单?\\n\\n加入 **4·23 飞书读书节**,分享你的**挚爱书单**及**读书笔记**,**赢取千元读书礼**!\\n\\n📬 填写问卷,晒出你的珍藏好书\\n😍 想知道其他人都推荐了哪些好书?马上[入群围观](https://open.feishu.cn/)\\n📝 用[读书笔记模板](https://open.feishu.cn/)(桌面端打开),记录你的心得体会\\n🙌 更有惊喜特邀嘉宾 4月12日起带你共读\",\"tag\":\"lark_md\"}},{\"actions\":[{\"tag\":\"button\",\"text\":{\"content\":\"立即推荐好书\",\"tag\":\"plain_text\"},\"type\":\"primary\",\"url\":\"https://open.feishu.cn/\"},{\"tag\":\"button\",\"text\":{\"content\":\"查看活动指南\",\"tag\":\"plain_text\"},\"type\":\"default\",\"url\":\"https://open.feishu.cn/\"}],\"tag\":\"action\"}],\"header\":{\"template\":\"turquoise\",\"title\":{\"content\":\"📚晒挚爱好书,赢读书礼金\",\"tag\":\"plain_text\"}}}"
}'
响应示例响应示例
{
"code": 0,
"data": {},
"msg": "ok"
}
请求参数
Path 参数
message_id
必需
示例值:
om_dc13264520392913993dd051dba21dcf
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json