# 引用消息发送说明

<div class="qiwe-hero" style="background: linear-gradient(135deg, rgba(255, 213, 145, 0.45) 0%, rgba(255, 255, 255, 0.06) 100%); border: 1px solid rgba(255, 236, 202, 0.7); border-radius: 12px; padding: 28px 32px; margin-bottom: 24px; box-shadow: 0 4px 12px rgba(250, 140, 22, 0.08);">
 <h1 style="margin: 0 0 10px 0; font-size: 26px; font-weight: 600; color: inherit; border: none; padding-bottom: 0;">引用消息发送说明</h1>
 <p style="margin: 0 0 16px 0; font-size: 15px; color: inherit; line-height: 1.6;">在回复特定消息时，可通过 reply 参数实现引用回复，让对话上下文更清晰。</p>
 <div style="display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px;">
 <a href="api-344613913" class="qiwe-tag" style="text-decoration: none; background: rgba(255, 247, 230, 0.55); border: 1px solid rgba(255, 213, 145, 0.65); border-radius: 4px; padding: 2px 10px; color: #AD6800; font-weight: 400;">发送纯文本消息</a>
 <a href="api-344613914" class="qiwe-tag" style="text-decoration: none; background: rgba(255, 247, 230, 0.55); border: 1px solid rgba(255, 213, 145, 0.65); border-radius: 4px; padding: 2px 10px; color: #AD6800; font-weight: 400;">发送混合文本消息</a>
 <a href="doc-7331304" class="qiwe-tag" style="text-decoration: none; background: rgba(255, 247, 230, 0.55); border: 1px solid rgba(255, 213, 145, 0.65); border-radius: 4px; padding: 2px 10px; color: #AD6800; font-weight: 400;">回调结构说明</a>
 </div>
</div>

<div class="qiwe-notice" style="background: rgba(255, 247, 230, 0.2); border: 1px solid rgba(255, 213, 145, 0.55); border-radius: 6px; padding: 12px 16px; margin-bottom: 24px;">
 <p style="margin: 0; font-size: 13px; line-height: 1.6; color: inherit;"><strong>前置条件：</strong>发送前请确认对方为正常好友关系，否则消息将发送失败。</p>
</div>

<div style="margin-bottom: 24px;">
 <div class="qiwe-notice" style="background: rgba(255, 247, 230, 0.2); border: 1px solid rgba(255, 213, 145, 0.55); border-radius: 6px; padding: 12px 16px; margin-bottom: 24px;">
 <!-- 关键修复：将p标签替换为div，禁止p内嵌套div -->
 <div style="margin: 0 0 14px 0; font-size: 14px; line-height: 1.6; color: inherit;">
 <strong>功能说明</strong>
 </div>
 <div style="padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid rgba(255, 213, 145, 0.35);">
 <p style="margin: 0; font-size: 14px; color: inherit; line-height: 1.7;"><strong>支持接口：</strong>仅 <a href="api-344613913" style="">发送纯文本消息</a> 和 <a href="api-344613914" style="">发送混合文本消息</a> 支持引用，其他消息类型暂不支持。</p>
 </div>

 <div style="padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid rgba(255, 213, 145, 0.35);">
 <p style="margin: 0; font-size: 14px; color: inherit; line-height: 1.7;"><strong>可引用类型：</strong>0 文本、14 图片、15 文件、16 语音、23 视频、29 表情。</p>
 </div>

 <div>
 <p style="margin: 0; font-size: 14px; color: inherit; line-height: 1.7;"><strong>参数规则：</strong>reply.msgData 结构随 reply.type 变化，详见 <a href="doc-7331304" style="">回调结构说明</a> 中对应消息体的 msgData 结构。</p>
 </div>
 </div>
</div>

<div class="qiwe-card" style="background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 236, 202, 0.22) 100%); border: 1px solid rgba(255, 236, 202, 0.7); border-radius: 10px; padding: 24px; box-shadow: 0 2px 6px rgba(250, 140, 22, 0.06); margin-bottom: 24px;">
 <div style="display: flex; align-items: center; gap: 10px; margin-bottom: 16px;">
 <h2 style="margin: 0; font-size: 18px; color: inherit; font-weight: 600; border: none; padding-bottom: 0;">请求示例</h2>
 </div>

 <h4 style="margin: 0 0 8px 0; font-size: 14px; color: inherit; font-weight: 600; opacity: 0.85;">发送文本消息 + 引用文件</h4>

```
{
 "method": "/msg/sendText",
 "params": {
 "guid": "{{guid}}",
 "content": "你好，这是你第一条企业微信消息",
 "toId": "168****768657",
 "isNoNeedRead": true,
 "reply": {
 "type": 15,
 "msgServerId": 1003054,
 "userId": "168********23231",
 "showName": "非必需，可选",
 "timeStamp": 1625957403,
 "msgUniqueIdentifier": "CAQQFdfkdYY1+C/qomAgAMg5+7DyQE=",
 "msgData": {
 "fileId": "306902010204623060020100020**********342d6164326131353032653862300201000203018bd00410367086416687ce5b51963e0ffd98ddf70201050201000400",
 "fileSize": 101317,
 "fileMd5": "3670864166****63e0ffd98ddf7",
 "filename": "JPEG 图像.jpeg",
 "filenameExt": "jpeg",
 "fileAesKey": "d8af09b058*****f3fcfd9169d723"
 }
 }
 }
}
```

 <h4 style="margin: 20px 0 8px 0; font-size: 14px; color: inherit; font-weight: 600; opacity: 0.85;">发送混合文本消息 + 引用文本</h4>

```
{
 "method": "/msg/sendHyperText",
 "params": {
 "guid": "{{guid}}",
 "content": [
 {
 "subtype": 2,
 "text": "[微笑][憨笑]"
 },
 {
 "subtype": 1,
 "text": ""
 },
 {
 "subtype": 0,
 "text": " 我是mac.stone"
 }
 ],
 "toId": "7881302602370971",
 "reply": {
 "type": 0,
 "userId": "788*******450",
 "showName": "",
 "timeStamp": 1625951302,
 "msgUniqueIdentifier": "3504********323",
 "msgData": {
 "content": "我是第一百个为妖刀应援的阴阳"
 }
 }
 }
}
```

 <div class="qiwe-success" style="margin-top: 20px; background: rgba(82, 196, 26, 0.12); border: 1px solid rgba(82, 196, 26, 0.35); border-radius: 6px; padding: 12px 16px;">
 <p style="margin: 0; font-size: 14px; color: #389E0D;">引用参数填写正确后，发送的消息将附带被引用消息的上下文展示。</p>
 </div>
</div>

<div class="qiwe-notice" style="background: rgba(255, 247, 230, 0.2); border: 1px solid rgba(255, 213, 145, 0.55); border-radius: 6px; padding: 12px 16px; margin-bottom: 24px;">
 <p style="margin: 0; font-size: 14px; color: inherit; line-height: 1.8;"><strong>使用注意</strong><br/>1. reply.type 须与被引用消息类型一致，否则可能发送失败。<br/>2. 建议从 <a href="doc-9079960" style="color: inherit; text-decoration: underline; font-weight: 600;">Webhook 事件</a> 推送的原始消息中提取 msgData 字段，避免手动拼装错误。</p>
</div>
