GuidRequest 接口(OpenApp 鉴权)管理回调 URL,设置后设备事件自动 POST 到指定地址。callback_url。POST {callback_url}
Content-Type: application/json
AppKey: {open_app 的 app_key}
AppSecret: {open_app 的 app_secret}{
"guid": "ad1615a1ee59860e",
"notify_type": 1,
"payload": { ... }
}| notify_type | 类型 | 说明 |
|---|---|---|
| 1 | 设备上线 | 设备连接成功,含企微用户资料 |
| 2 | 设备下线 | 设备断开连接 |
| 3 | 新消息 | 收到聊天消息(数组) |
| 4 | 客户申请 | 收到好友申请 |
| 5 | 客户变更 | 联系人信息变更 |
| 6 | 群信息变更 | 群信息/群成员等变更 |
| 7 | 朋友圈变更 | 朋友圈新增动态/评论/点赞等(v1.0.44+) |
| 8 | 朋友圈任务 | 管理员下发朋友圈任务/提醒(v1.0.44+) |
| 9 | 群发任务 | 管理员群发任务提醒(v1.0.44+) |
| 10 | 群名称变更 | 群被改名(v1.0.44+) |
{
"guid": "ad1615a1ee59860e",
"notify_type": 1,
"payload": {
"profile": {
"user_id": "1688853377964182",
"name": "张三",
"avatar": "https://wx.qlogo.cn/xxx",
"corp_id": "1970325782990871",
"corp_short_name": "XX科技",
"corp_full_name": "XX科技有限公司"
}
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| profile.user_id | string | 企微 uin |
| profile.name | string | 用户昵称 |
| profile.avatar | string | 头像 URL |
| profile.corp_id | string | 企业 ID |
| profile.corp_short_name | string | 企业简称 |
| profile.corp_full_name | string | 企业全称 |
corp_* 三字段需网关 v1.0.44+,旧版可能缺失。
{
"guid": "ad1615a1ee59860e",
"notify_type": 2,
"payload": {
"profile": {
"user_id": "1688853377964182",
"name": "张三"
},
"scene": 1
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| profile.user_id | string | 企微 uin |
| profile.name | string | 用户昵称 |
| scene | int | 下线场景 |
{
"guid": "ad1615a1ee59860e",
"notify_type": 3,
"payload": {
"messages": [
{
"msg_type": "text",
"id": "41952752",
"seq": "23629366",
"sender": "1688858271876706",
"receiver": "1688855875615249",
"roomid": "10855906979082597",
"sender_name": "张三",
"sendtime": 1793957776,
"content_type": 2,
"referid": "0",
"flag": 83886592,
"appinfo": "CIGABBD4vrbXBhjijPyqn4CAAyDvWQ==",
"asid": "0",
"extra_content": "base64 编码的额外数据",
"msg": {
"content": "你好",
"at_list": ["7881300144304401"]
}
}
]
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg_type | string | 消息类型,见下表 |
| id | string | 消息 ID(用户维度唯一) |
| seq | string | 消息序号(用户维度唯一) |
| appinfo | string | 消息全局唯一 ID(撤回、引用消息会用到) |
| sender | string | 发送者 ID |
| receiver | string | 接收者 ID |
| roomid | string | 群 ID;私聊为 "0" |
| sender_name | string | 发送者昵称 |
| sendtime | int | 发送时间戳(秒) |
| content_type | int | 内容类型 |
| referid | string | 0=原消息;非 0 时其值等于某条消息的 id,代表该消息的附属事件(已读回执、撤回等) |
| flag | int | 消息标记位 |
| asid | string | 客服场景账号 ID,一般为 "0" |
| extra_content | string | 额外数据(被引用消息快照等,base64) |
| msg | object | 消息体,字段随 msg_type 变化,见下表 |
| msg_type | 说明 | msg 内主要字段 |
|---|---|---|
| text | 文本 | content、at_list |
| image | 图片 | file_id、aes_key、auth_key、md5、size、image_width、image_height、is_hd |
| video / big_video | 视频 | file_id、aes_key、auth_key、md5、size、video_duration、video_width、video_height、preview_img_file_id;big_video 另有 preview_image_* 封面字段 |
| voice | 语音 | file_id、aes_key、md5、size、voice_time(秒) |
| file | 文件 | file_id、aes_key、md5、size、file_name |
| emotion | 表情 | url、md5、image_width、image_height |
| link | 链接卡片 | title、desc、url、image_url |
| location | 位置 | title、address、longitude、latitude、zoom |
| personal_card | 个人名片 | user_id |
| weapp | 小程序 | title、appname、appid、page_path、appicon、username、file_id、aes_key、md5、size |
| feed_video / feed_live / feed_video_h5 / finder_video_h5 | 视频号 | nickname、title、desc、url、cover_url、avatar 等 |
| mixed | 图文混合 | msg_list |
| app_text_card | 文本卡片 | title、desc、url |
| forward / nested_forward | 合并转发 | message_title、message_list |
| revoke | 撤回 | msg 为事件骨架;被撤回消息 id 见顶层 referid |
| hongbao | 红包 | hongbao_id、money(分)、remark、desc |
| transfer | 转账 | 转账提示文案 |
| word_chain | 群接龙 | content、chain_config |
| system | 系统提示 | content |
| pv_merge_single | 音视频通话记录 | record_wording(未接听/对方已取消等)、record_type |
图片/视频/语音/文件的 file_id、aes_key、md5、size是下载凭证,可直接传给 CDN下载文件 下载。
msg 消息体结构。示例均来自线上真实消息(超长凭证字段已截短)。| 字段 | 类型 | 说明 |
|---|---|---|
| msg.content | string | 文本内容;@某人时内容里带 @昵称 尾缀 |
| msg.at_list | string[] | 被 @ 的用户 ID 列表(无 @ 时字段缺失),"0" 表示 @所有人 |
| msg.quote_appinfo | string | 引用消息时为被引用消息的 appinfo |
| msg.quote_content | string | 引用摘要(可能为空) |
引用消息:被引用原消息的完整快照在顶层 extra_content(base64 编码)。
"msg": {
"content": "这个是旧的吧?要新的FBA19QRMMGNS@慧宇港前 ",
"at_list": ["7881300144304401"],
"quote_appinfo": "6940925687550447375",
"quote_content": ""
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.file_id | string | CDN 文件标识(URL 形态,实际下发为完整地址) |
| msg.aes_key | string | 解密密钥 |
| msg.auth_key | string | 鉴权凭证(可能为空) |
| msg.md5 | string | 文件 MD5 |
| msg.size | int | 文件字节数 |
| msg.image_width | int | 图片宽(像素) |
| msg.image_height | int | 图片高(像素) |
| msg.is_hd | bool | 是否原图 |
"msg": {
"file_id": "https://imunion.weixin.qq.com/...(完整 URL)",
"aes_key": "73d70ead3a5876cd97cbab6e5cfb1c17",
"auth_key": "v1_dfc7d18371ea90f154ef2...",
"md5": "dc0300e806912072fb776ab9baa37c4a",
"size": 57338,
"image_width": 150,
"image_height": 105,
"is_hd": false
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.file_id | string | CDN 文件标识(URL 形态) |
| msg.aes_key / msg.auth_key / msg.md5 / msg.size | — | 下载凭证(同图片) |
| msg.file_name | string | 文件名(可能为空) |
| msg.video_duration | int | 时长(秒) |
| msg.video_width / msg.video_height | int | 视频分辨率 |
| msg.preview_img_file_id | string | 封面图 CDN 标识 |
| msg.preview_img_size | int | 封面图大小(字节) |
big_video(大视频)另有 preview_image_url(封面直链)与preview_image_width / preview_image_height / preview_image_size / preview_image_md5。
"msg": {
"file_id": "https://imunion.weixin.qq.com/...(完整 URL)",
"aes_key": "97359c5f73f8961ddcb6e5c0a2925414",
"auth_key": "v1_4942a3efb0ee9353d5946...",
"md5": "e59c5e076eada47e36e1a253bafb738a",
"size": 6841441,
"file_name": "",
"video_duration": 42,
"video_width": 1080,
"video_height": 1920,
"preview_img_file_id": "https://imunion.weixin.qq.com/...(完整 URL)",
"preview_img_size": 7710
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.file_id | string | CDN 文件标识(hex 串形态) |
| msg.aes_key / msg.md5 | string | 解密凭证 |
| msg.size | int | 文件字节数 |
| msg.voice_time | int | 语音时长(秒) |
"msg": {
"file_id": "308181020102047a30780201...",
"aes_key": "6F6E626A6F63656374796D6F62756366",
"md5": "9584c336d1091943119692e58f5e0db6",
"size": 26727,
"voice_time": 15
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.file_id | string | CDN 文件标识(hex 串形态) |
| msg.aes_key / msg.md5 | string | 解密凭证 |
| msg.size | int | 文件字节数 |
| msg.file_name | string | 文件名(含扩展名) |
"msg": {
"file_id": "306b02010204643062020100...",
"aes_key": "66373232333637313665623563343138",
"md5": "7822499fe5fc1838fbdd8258d0a3e801",
"size": 904140,
"file_name": "报关资料1106.zip"
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.url | string | 表情图直链 URL,可直接展示 |
| msg.md5 | string | 文件 MD5 |
| msg.image_width / msg.image_height | int | 尺寸(像素) |
file_id / aes_key / size 一般为空值,直接用 url 展示即可。
"msg": {
"url": "https://wework.qpic.cn/wework_pic/...",
"md5": "8b72abdfbac216939cd3c9a7f42d221c",
"image_width": 240,
"image_height": 258
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.title | string | 标题 |
| msg.desc | string | 描述 |
| msg.url | string | 跳转链接 |
| msg.image_url | string | 缩略图 URL |
| msg.cdn | object | 可选。部分带图卡片(如会议邀请)的封面图 CDN 凭证,字段同 image(file_id / aes_key / auth_key / md5 / size) |
"msg": {
"title": "邀请你加入群聊",
"desc": "运营-小邱邀请你加入群聊",
"url": "https://work.weixin.qq.com/...",
"image_url": "https://wework.qpic.cn/wework_pic/..."
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.title | string | 位置名称 |
| msg.address | string | 详细地址 |
| msg.longitude | double | 经度 |
| msg.latitude | double | 纬度 |
| msg.zoom | int | 地图缩放级别 |
"msg": {
"title": "龙户人家串串香火锅(奎星楼店)",
"address": "四川省成都市青羊区吉祥苑39号附1号",
"longitude": 104.052276611,
"latitude": 30.669752121,
"zoom": 15
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.title | string | 消息标题 |
| msg.appname | string | 小程序名称 |
| msg.appid | string | 小程序 appid |
| msg.username | string | 小程序原始 ID(gh_xxx@app) |
| msg.page_path | string | 页面路径 |
| msg.appicon | string | 图标 URL |
| msg.file_id / msg.aes_key / msg.md5 / msg.size | — | 封面图 CDN 凭证 |
"msg": {
"title": "进入小程序->点击保存至相册",
"appname": "小飞豆去水印",
"appid": "wx10572f6c399c5df7",
"username": "gh_47d063cd6d11@app",
"page_path": "pages/video/index.html?...",
"appicon": "http://wx.qlogo.cn/mmhead/...",
"file_id": "30819602010204818e30818b...",
"aes_key": "76786A736475706D707962796A6B7868",
"md5": "4e2b88af29a4c842ebab288db64e2cfd",
"size": 147895
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.feed_type | int | 视频号内容类型 |
| msg.nickname | string | 视频号账号昵称 |
| msg.avatar | string | 账号头像 URL |
| msg.title | string | 卡片标题("[视频号]" + 内容标题) |
| msg.desc | string | 内容描述 |
| msg.url | string | 跳转链接 |
| msg.cover_url / msg.image_url | string | 封面图 URL |
| msg.thumb_url | string | 缩略图 URL(可能为空) |
| msg.export_new_url | string | 导出链接 |
| msg.is_h5 / msg.use_h5 | bool | H5 卡片标记 |
| msg.is_horizontal | bool | 是否横屏 |
| msg.live_status | int | 直播状态(feed_live 相关) |
| msg.extras / msg.object_id / msg.object_nonce_id | string | 扩展信息(可能为空) |
"msg": {
"feed_type": 4,
"nickname": "金石三维深圳总生产基地",
"avatar": "https://wx.qlogo.cn/finder/...",
"title": "[视频号]尼龙3d打印和注塑要怎么选#3d打印#注塑模具",
"desc": "尼龙3d打印和注塑要怎么选#3d打印#注塑模具#塑料成型#机械原理",
"url": "https://channels.weixin.qq.com/...",
"cover_url": "https://finder.video.qq.com/...",
"image_url": "https://finder.video.qq.com/...",
"export_new_url": "https://channels.weixin.qq.com/...",
"is_h5": true,
"use_h5": true,
"is_horizontal": false,
"live_status": 0,
"thumb_url": "",
"extras": "",
"object_id": "",
"object_nonce_id": ""
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.msg_list | array | 子消息列表,每项结构同顶层消息(msg_type / sender / sender_name / sendtime / content_type / conv_id / conv_type / corp_id / appinfo / extra_content / msg) |
"msg": {
"msg_list": [
{
"msg_type": "image",
"sender": "0",
"sender_name": "",
"sendtime": 0,
"content_type": 14,
"conv_id": "0",
"conv_type": 0,
"corp_id": "0",
"appinfo": "",
"msg": {
"file_id": "306a02010204633061020100...",
"aes_key": "54499d68c0a1aa8cf75298dad28df9bc",
"md5": "daa914f99c82770aabe1df6022c1c96e",
"size": 22141,
"image_width": 964,
"image_height": 175,
"is_hd": true
}
},
{
"msg_type": "text",
"sender": "0",
"sender_name": "",
"sendtime": 0,
"content_type": 2,
"conv_id": "0",
"conv_type": 0,
"corp_id": "0",
"appinfo": "",
"msg": {
"content": "@王莲 不带芯片",
"at_list": ["1688854525943308"]
}
}
]
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.message_title | string | 合集标题(如 "张三的聊天记录") |
| msg.message_list | array | 子消息列表,结构同 mixed 的 msg_list;nested_forward 的子项可再嵌一层(子项 msg 内含 messages 数组) |
"msg": {
"message_title": "大米的聊天记录",
"message_list": [
{
"msg_type": "image",
"sender": "0",
"sender_name": "大米",
"sendtime": 1793899861,
"content_type": 101,
"conv_id": "0",
"conv_type": 0,
"corp_id": "1970325134026788",
"appinfo": "",
"msg": {
"file_id": "https://imunion.weixin.qq.com/...",
"aes_key": "ec856fd6e561b1ced6f964af356891b7",
"auth_key": "v1_3f6c9c18740f8ab9bdd20...",
"md5": "12861bc638c17cfbc1558d99c0e7d23a",
"size": 287124
}
},
{
"msg_type": "text",
"sender": "0",
"sender_name": "大米",
"sendtime": 1793899868,
"content_type": 2,
"conv_id": "0",
"conv_type": 0,
"corp_id": "1970325134026788",
"appinfo": "",
"msg": { "content": "破损" }
}
]
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.user_id | string | 名片对应的企微用户 ID |
| 字段 | 类型 | 说明 |
|---|---|---|
| msg.title | string | 标题 |
| msg.desc | string | 描述 |
| msg.url | string | 跳转链接 |
msg 不是常规消息体,而是事件骨架(id / seq 为 "0")。被撤回消息的 id 在顶层 referid(其值等于被撤回那条消息的 id 字段)。"msg": {
"id": "0",
"seq": "0",
"roomid": "10773936684217073",
"sender": "1688856934750639",
"receiver": "0",
"sendtime": 1793957731,
"content_type": 0,
"referid": "0",
"flag": 32,
"appinfo": "CIGABBDjvrbXBhivs7CtmoCAAyD6Bw==",
"asid": "0"
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.hongbao_id | string | 红包 ID |
| msg.money | int | 金额(分) |
| msg.remark | string | 祝福语 |
| msg.desc | string | 提示文案(如 "来自xx的红包,请进入手机版企业微信查看") |
"msg": {
"hongbao_id": "1800008896202611067245505760033",
"money": 1000,
"remark": "恭喜发财,大吉大利",
"desc": "来自_阿巧的红包,请进入手机版企业微信查看"
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.content | string | 接龙全文("#接龙\n\n1. xxx\n2. xxx" 格式) |
| msg.chain_config | object | 接龙配置 |
| msg.chain_config.chain_type | int | 接龙类型 |
| msg.chain_config.creator_id | string | 发起人 ID |
| msg.chain_config.delimiter | string | 序号分隔符 |
| msg.chain_config.start_position / end_position / placeholder | string | 位置标记 |
| msg.chain_config.version | int | 版本号 |
| msg.chain_config.participant_edits | array | 参与者编辑记录,每项含 user_id / content_range / edit_timestamp / edit_type / content_delimiter |
"msg": {
"content": "#接龙\n\n1. TTclub_坨面\n2. TTclub_七星(恩师坨坨)",
"chain_config": {
"chain_type": 1,
"creator_id": "7881301818129670",
"delimiter": ".",
"start_position": "0-3",
"end_position": "0-0",
"placeholder": "0-0",
"version": 0,
"participant_edits": [
{
"user_id": "7881301818129670",
"content_range": "8-9",
"edit_timestamp": 1793958955,
"edit_type": 0,
"content_delimiter": "."
}
]
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| msg.content | string | 提示文案(如 "xx开启了联系人验证,你还不是他(她)的联系人") |
| 字段 | 类型 | 说明 |
|---|---|---|
| msg.invite_type | int | 邀请类型 |
| msg.record_type | int | 记录类型 |
| msg.record_wording | string | 状态文案(如 "未接听"、"对方已取消") |
| msg.record_time | int | 通话时间戳 |
| msg.accept_or_reject_imei | string | 接听/拒绝设备标识 |
| msg.accept_or_reject_platform / msg.valid_platform | int | 平台标识 |
{
"guid": "ad1615a1ee59860e",
"notify_type": 4,
"payload": null
}当前版本 payload 暂无数据,收到申请后调用同步申请联系人接口获取明细。
{
"guid": "ad1615a1ee59860e",
"notify_type": 5,
"payload": null
}当前版本 payload 暂无数据,收到后调用同步联系人接口获取最新列表。
{
"guid": "ad1615a1ee59860e",
"notify_type": 6,
"payload": {
"room_id": "1234567890",
"operator_id": "1688853377964182"
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| room_id | string | 群 ID |
| operator_id | string | 操作者企微 uin |
{
"guid": "ad1615a1ee59860e",
"notify_type": 7,
"payload": {
"sendtime": 1793957776,
"sid": "1234567890",
"type": 4,
"postid": "base64 编码的动态 ID"
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| sendtime | int | 事件时间戳(秒) |
| sid | string | 朋友圈动态 ID |
| type | int | 变更类型(位标记):0=新增评论 1=删除评论 2=新增点赞 3=删除点赞 4=新增动态 5=删除动态 6=封面点赞 |
| postid | string | 朋友圈 postid(base64) |
{
"guid": "ad1615a1ee59860e",
"notify_type": 8,
"payload": {
"sendtime": 1793957776,
"appinfo": "base64 编码的原始消息 appinfo",
"sns_info": {
"type": 2,
"title": "任务标题"
}
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| sendtime | int | 事件时间戳(秒) |
| appinfo | string | 原始消息 appinfo(base64) |
| sns_info.type | int | 2=管理员下发新任务 3=管理员任务提醒 4=成为负责人 5=规则变更 6=可见范围变更 7=修改封面 |
| sns_info.title | string | 任务标题(base64) |
{
"guid": "ad1615a1ee59860e",
"notify_type": 9,
"payload": {
"sendtime": 1793957776,
"appinfo": "base64 编码的原始消息 appinfo",
"group_msg": {
"admin_vid": "1688853377964182",
"msgid": "1234567890",
"title": "任务标题",
"content": "任务内容",
"type": 1,
"msgts": 1793957776
}
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| sendtime | int | 事件时间戳(秒) |
| appinfo | string | 原始消息 appinfo(base64) |
| group_msg | object | 群发任务信息 |
| group_msg.admin_vid | string | 下发任务的管理员 ID |
| group_msg.msgid | string | 任务 ID |
| group_msg.title | string | 任务标题 |
| group_msg.content | string | 任务内容 |
| group_msg.type | int | 任务类型 |
| group_msg.msgts | int | 任务时间戳 |
{
"guid": "ad1615a1ee59860e",
"notify_type": 10,
"payload": {
"room_id": "10750973332920638",
"room_name": "新群名称",
"operator_id": "1688857050497654"
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| room_id | string | 群 ID |
| room_name | string | 新群名称 |
| operator_id | string | 操作者企微 uin |
user_id、room_id、operator_id)AppKey + AppSecret(来自设置回调的 OpenApp)