- 文档必读
- 个人微信
- 个人微信(DLL) 支持http+tcp
- 企业微信(开发中)
- 更新日志
- 插件敏感词审核机制
收到私聊消息事件
POST
http://callbackurl
请求参数
Body 参数application/json
event
enum<string>
事件类型
枚举值:
10002
description
string
事件描述
示例值:
私聊消息事件
time
integer
毫秒时间戳
示例值:
1726826627676
data
object
数据体
robotId
string
机器人id
instanceId
string
实例id
示例值:
97554f7c82a1439c86df3143ef4975c5
timeStamp
integer
接收到消息的时间
示例值:
1726826627676
messageId
string
消息id
示例值:
7053704521966022857
messageType
integer
必需
3 图片
34 语音
42 名片
43 视频
47 动态表情
48 地理位置
49 分享链接或附件 2001 红包
2002 小程序
2003 群邀请
10000 系统消息
示例值:
1
fromType
enum<string>
消息来源
group 群聊
official 公众号
枚举值:
private
messageSource
integer
必需
1消息 为自己发送
fromWxId
string
好友wxid
示例值:
test
fromNickName
string
好友昵称
示例值:
好友昵称
message
string
消息内容
示例值:
测试消息
toWxId
string
messageSource=0时生效,发送给对方的wxid
示例
{
"event": "10002",
"description": "私聊消息事件",
"time": 1726826627676,
"data": {
"robotId": "string",
"instanceId": "97554f7c82a1439c86df3143ef4975c5",
"timeStamp": 1726826627676,
"messageId": "7053704521966022857",
"messageType": 1,
"fromType": "private",
"messageSource": 0,
"fromWxId": "test",
"fromNickName": "好友昵称",
"message": "测试消息",
"toWxId": "string"
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://callbackurl' \
--header 'Content-Type: application/json' \
--data-raw ''
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2024-12-26 06:31:48