Appearance
发送链接
向好友或群聊发送链接卡片消息。
接口地址: POST /sendUrl
前置条件
- 微信实例已登录,并已获得可用的
wId。 - 接收方
wcId可以是好友微信 ID,也可以是群 ID。 url需要是接收方微信客户端可访问的公网链接。thumbUrl建议使用稳定公网图片,格式为 JPG 或 PNG,大小控制在 50KB 以内。
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| wId | 是 | string | 登录实例标识 |
| wcId | 是 | string | 接收方微信 ID 或群 ID |
| title | 是 | string | 链接标题 |
| url | 是 | string | 跳转链接 |
| description | 是 | string | 链接描述 |
| thumbUrl | 是 | string | 卡片缩略图 URL,JPG/PNG 格式,50KB 以内 |
响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | 1000 成功,1001 失败 |
| message | string | 反馈信息 |
| data.type | int | 类型 |
| data.msgId | long | 消息 ID |
| data.newMsgId | long | 新消息 ID |
| data.createTime | long | 发送时间戳(秒) |
| data.wcId | string | 接收方 ID |
请求示例
json
{
"wId": "0000016f-63d2-ea61-000e-a659a75ea445",
"wcId": "jack_623555049",
"title": "Eyun 接入指南",
"url": "https://timgsa.182.40.194.50/timg?image&quality=80&size=b9999_10000&sec=1577945612638&di=81a0281095a337037abf85f29929b55f&imgtype=0&src=http%3A%2F%2Fimage5.92bizhi.com%2Funclassified_unclassified--122_26-1600x1200.jpg",
"description": "快速了解登录、消息发送和回调配置流程",
"thumbUrl": "https://timgsa.182.40.194.50/timg?image&quality=80&size=b9999_10000&sec=1577945612638&di=81a0281095a337037abf85f29929b55f&imgtype=0&src=http%3A%2F%2Fimage5.92bizhi.com%2Funclassified_unclassified--122_26-1600x1200.jpg"
}成功响应
json
{
"code": "1000",
"message": "发送链接成功",
"data": {
"type": null,
"msgId": 697760503,
"newMsgId": 181228940242588250,
"createTime": 1641457185,
"wcId": "wxid_amdhbnjfj3d"
}
}错误响应
json
{
"message": "失败",
"code": "1001",
"data": null
}使用建议
- 链接卡片适合营销页、活动页和文章分享;纯文本 URL 建议使用发送文本消息接口。
- 建议业务侧在发送前校验
url、thumbUrl是否可访问,避免微信端展示空白卡片。 - 发送成功后保存
msgId、newMsgId、createTime,便于追踪发送结果或执行撤回。
