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 | 群信息变更 | 群名/群成员等变更 |
{
"guid": "ad1615a1ee59860e",
"notify_type": 1,
"payload": {
"profile": {
"user_id": "1688853377964182",
"name": "张三",
"avatar": "https://wx.qlogo.cn/xxx"
}
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| profile.user_id | string | 企微 uin |
| profile.name | string | 用户昵称 |
| profile.avatar | string | 头像 URL |
{
"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_id": "1234567890",
"from_user_id": "1688853377964182",
"to_user_id": "vid_xxx",
"msg_type": 1,
"create_time": 1718000000,
"content": "Hello"
}
]
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| messages | array | 消息对象数组(JSON 对象,非字符串) |
messages为 JSON 对象数组,每条消息的具体字段取决于msg_type(文本/图片/文件等)。
{
"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 |
user_id、room_id、operator_id)AppKey + AppSecret(来自设置回调的 OpenApp)