Usage
In the reply, output ```json ``` code block, with content matching the JSON Schema template card JSON. The plugin automatically extracts and sends it.
你的回复文本...
```json
{
"card_type": "...",
...
}
```
Generation Rules
- Generate strictly according to the schema: field names, types, and nested structures must be completely consistent with the JSON Schema definition in ./references/api-template-card-types.md is completely consistent with the JSON Schema definition in
- Each card must have
task_id: format task_{场景}_{时间戳}, can only contain digits, letters,_-@
- Do not call
wecom-cli or other tools to send the card; directly output the JSON code block in the final reply
- Text outside the code block will be sent as a normal reply
Card Type Selection
Decision Process
用户需求是否需要交互?
├─ 否(纯通知/信息推送)
│ ├─ 需要图片展示? → news_notice
│ └─ 不需要图片 → text_notice
│
└─ 是(需要用户操作)
├─ 从有限选项中做一个操作(≤6个按钮)→ button_interaction
├─ 从一组选项中投票/选择(可多选) → vote_interaction
└─ 提供多个维度的选择(≤3个下拉框) → multiple_interaction
Scenario Quick Reference
| card_type |
Typical Scenario |
text_notice |
System alerts, deployment notifications, daily data reports, approval results, holiday announcements |
news_notice |
News pushes, event promotions, product launches, weekly reports with charts, new employee introductions |
button_interaction |
Approvals (approve/reject), ticket handling (accept/transfer), confirmation operations, satisfaction ratings, secondary confirmation (yes/no) |
vote_interaction |
Team building voting, meeting time coordination, single-question surveys, opinion collection, proposal selection |
multiple_interaction |
Multi-dimensional information collection (department + floor + time), fault reporting tickets (type + urgency), meeting room booking (date + time + room) |
Distinguishing Easily Confused Cards
- button_interaction vs vote_interaction: Button type is suitable for "few options + immediate action" (such as confirm/cancel), while voting type is suitable for "many options + multiple selections + unified submission" (such as voting)
- vote_interaction vs multiple_interaction: Voting type is "one question with multiple selections", while multiple choice type is "multiple independent questions each with one selection" (such as selecting time and location at the same time)
Required Fields Quick Reference
| card_type |
required |
text_notice |
card_type, task_id, card_action, (main_title or sub_title_text at least one) |
news_notice |
card_type, task_id, main_title, card_action |
button_interaction |
card_type, task_id, main_title, button_list |
vote_interaction |
card_type, task_id, title, options |
multiple_interaction |
card_type, task_id, title, selectors |
Minimal Example
text_notice
{
"card_type": "text_notice",
"main_title": { "title": "项目进度更新", "desc": "进度已达 80%" },
"emphasis_content": { "title": "80%", "desc": "完成度" },
"card_action": { "type": 1, "url": "https://work.weixin.qq.com" },
"task_id": "task_progress_1711234567"
}
news_notice
{
"card_type": "news_notice",
"main_title": { "title": "新功能上线", "desc": "v5.0 已发布" },
"card_image": { "url": "https://wework.qpic.cn/wwpic/xxx/0" },
"card_action": { "type": 1, "url": "https://work.weixin.qq.com" },
"task_id": "task_release_1711234568"
}
button_interaction
{
"card_type": "button_interaction",
"main_title": { "title": "方案选择", "desc": "请选择技术方案" },
"button_list": [
{ "text": "A方案-重构", "style": 1, "key": "plan_a" },
{ "text": "B方案-兼容", "style": 4, "key": "plan_b" }
],
"task_id": "task_plan_select_1711234569"
}
vote_interaction (simplified format)
{
"card_type": "vote_interaction",
"title": "团建投票",
"description": "选择你想参加的活动",
"options": [
{ "id": "hiking", "text": "爬山" },
{ "id": "dinner", "text": "聚餐" },
{ "id": "escape", "text": "密室逃脱" }
],
"mode": 1,
"submit_text": "提交投票",
"task_id": "task_team_vote_1711234570"
}
multiple_interaction (simplified format)
{
"card_type": "multiple_interaction",
"title": "团建安排",
"description": "分别选择时间和地点",
"selectors": [
{
"title": "时间",
"options": [
{ "id": "sat", "text": "周六" },
{ "id": "sun", "text": "周日" }
]
},
{
"title": "地点",
"options": [
{ "id": "park", "text": "公园" },
{ "id": "resort", "text": "度假村" }
]
}
],
"submit_text": "提交选择",
"task_id": "task_arrange_1711234571"
}