Skip to content

微信3.x HTTP接口文档 ​

基础地址: http://127.0.0.1:19088

所有接口均为 POST 请求,参数以 JSON 格式传递。


消息相关 ​

发送文本消息 ​

POST /api/send_text_msg

参数类型必填说明
wxidstring是接收人wxid
msgstring是消息内容
json
{"wxid": "filehelper", "msg": "Hello World!"}

发送文本消息(协议) ​

POST /api/send_text_pb

参数类型必填说明
wxidstring是接收人wxid
msgstring是消息内容
typestring是消息类型
json
{"wxid": "filehelper", "msg": "你好啊", "type": "1"}

发送图片消息 ​

POST /api/send_image_msg

参数类型必填说明
wxidstring是接收人wxid
image_pathstring是图片本地路径
json
{"wxid": "filehelper", "image_path": "c:\\1.jpg"}

发送文件 ​

POST /api/send_file_msg

参数类型必填说明
wxidstring是接收人wxid
full_pathstring是文件完整路径
json
{"wxid": "filehelper", "full_path": "C:\\Users\\Desktop\\file.md"}

发送语音(协议) ​

POST /api/send_voice

参数类型必填说明
toWxidstring是接收人wxid
silkPathstring是silk格式语音文件路径
secondsstring是语音时长(秒)
json
{"toWxid": "wxid_xxx", "silkPath": "D:\\output.silk", "seconds": "20"}

发送表情 ​

POST /api/send_custom_emotion

参数类型必填说明
wxidstring是接收人wxid
file_pathstring是表情文件路径
json
{"wxid": "filehelper", "file_path": "D:\\1.gif"}

发送名片 ​

POST /api/send_card_msg

参数类型必填说明
towxidstring是接收人wxid
fromwxidstring是名片wxid
json
{"towxid": "filehelper", "fromwxid": "wxid_xxx"}

发送At消息 ​

POST /api/send_at_text

参数类型必填说明
room_idstring是群聊ID
msgstring是消息内容
wxidsstring是被@人的wxid,notify@all表示@所有人
json
{"room_id": "50582745779@chatroom", "msg": "在干嘛呢", "wxids": "notify@all"}

发送引用消息 ​

POST /api/send_quote_msg

参数类型必填说明
wxidstring是接收人wxid或群聊ID
msgIdstring是被引用的消息ID
msgstring是回复内容
json
{"wxid": "50582745779@chatroom", "msgId": "8292128004080533745", "msg": "回复内容"}

撤回消息 ​

POST /api/revoke_msg

参数类型必填说明
index_idstring是消息索引ID
json
{"index_id": "4796650063682630984"}

转发单条消息 ​

POST /api/forward_single_msg

参数类型必填说明
msgidnumber是消息ID
wxidstring是转发目标wxid
json
{"msgid": 7123908525629997597, "wxid": "filehelper"}

个人信息 ​

获取自己详细信息 ​

POST /api/get_profile_cache

json
{}

登录 ​

POST /api/login

json
{}

检查登录状态 ​

POST /api/check_login

json
{}

刷新登录二维码 ​

POST /api/reflash_qrcode

json
{}

修改昵称 ​

POST /api/mod_self_nick_name

参数类型必填说明
newNamestring是新昵称
json
{"newName": "新昵称"}

好友管理 ​

获取好友列表 ​

POST /api/get_frien_lists

json
{}

获取好友详细信息(协议) ​

POST /api/net_scene_get_contact

参数类型必填说明
wxidsstring是wxid
roomIdstring否群聊ID
json
{"wxids": "wxid_xxx", "roomId": ""}

获取好友详细信息(缓存) ​

POST /api/get_contact_cache

参数类型必填说明
wxidstring是好友wxid
json
{"wxid": "wxid_xxx"}

网络搜索微信号 ​

POST /api/net_scene_search_contact

参数类型必填说明
searchstring是搜索关键词
json
{"search": "13671934252"}

添加好友 ​

POST /api/add_friend

参数类型必填说明
wxidstring是wxid 或 v3
greetstring是验证消息
scencestring是场景值
rolestring是朋友权限
json
{"wxid": "wxid_xxx", "greet": "你好啊", "scence": "30", "role": "0"}

通过好友 ​

POST /api/accept_friend

参数类型必填说明
v3string是v3数据
v4string是v4数据
scencestring是好友来源
rolestring是朋友权限
json
{"v3": "v3", "v4": "v4", "scence": "好友来源", "role": "朋友权限"}

删除好友 ​

POST /api/del_contact

参数类型必填说明
wxidstring是好友wxid
json
{"wxid": "wxid_xxx"}

群聊管理 ​

获取群聊列表 ​

POST /api/get_room_lists

json
{}

获取群成员列表 ​

POST /api/net_scene_get_member_from_chat_room

参数类型必填说明
room_idstring是群聊ID
json
{"room_id": "5367651578@chatroom"}

创建群聊 ​

POST /api/creat_chat_room

参数类型必填说明
wxidsstring是成员wxid,多个用逗号分隔
json
{"wxids": "wxid_xxx,wxid_yyy"}

设置群公告 ​

POST /api/set_room_announcement

参数类型必填说明
roomIdstring是群聊ID
announcementstring是公告内容
json
{"roomId": "53324112125@chatroom", "announcement": "测试公告"}

修改群聊名称 ​

POST /api/mod_chat_room_topic

参数类型必填说明
topicstring是新群名称
room_idstring是群聊ID
json
{"topic": "新群名称", "room_id": "57317789416@chatroom"}

拉人进群 ​

POST /api/add_member_to_chat_room

参数类型必填说明
wxid_liststring是要拉入的wxid
room_idstring是群聊ID
json
{"wxid_list": "wxid_xxx", "room_id": "38994638667@chatroom"}

踢出群聊 ​

POST /api/del_member_from_chat_room

参数类型必填说明
wxid_liststring是要踢出的wxid
room_idstring是群聊ID
json
{"wxid_list": "wxid_xxx", "room_id": "群wxid"}

数据库操作 ​

获取数据库句柄 ​

POST /api/get_db_handle

json
{}

执行sql语句 ​

POST /api/sqlite3_exec

参数类型必填说明
dbHandlestring是数据库句柄
sqlstring是SQL语句
json
{"dbHandle": "1622390499712", "sql": "select * from sqlite_master"}

朋友圈 ​

发朋友圈 ​

POST /api/sns_post

参数类型必填说明
contentstring是朋友圈文本内容
blackListstring否不可见名单
withauserListstring否可见名单
json
{"content": "这是我测试的朋友圈", "blackList": "", "withauserList": ""}

获取朋友圈首页 ​

POST /api/sns_get_first_page

json
{}

点赞朋友圈 ​

POST /api/sns_like

参数类型必填说明
sns_idstring是朋友圈ID
wxidstring是自己的wxid
json
{"sns_id": "14417590059746931229", "wxid": "wxid_xxx"}

其他功能 ​

CDN下载 ​

POST /api/cdn_download

参数类型必填说明
file_idstring是CDN文件ID
aes_keystring是AES解密密钥
save_pathstring是文件保存路径
json
{"file_id": "[file_id]", "aes_key": "[aes_key]", "save_path": "D:\\file.jpg"}

解码图片 ​

POST /api/decode_img

参数类型必填说明
pathstring是加密图片路径
savestring是解码后保存路径
json
{"path": "F:\\wechatflie\\xxx.dat", "save": "d:\\output.jpg"}

OCR识别 ​

POST /api/ocr

参数类型必填说明
wechatocr_exe_pathstring是WeChatOCR路径
wechat_dirstring是微信安装目录
img_pathstring是待识别图片路径
json
{
    "wechatocr_exe_path": "C:\\...\\WeChatOCR.exe",
    "wechat_dir": "D:\\WeChat\\[3.9.11.17]",
    "img_path": "C:\\image.png"
}

确认收款 ​

POST /api/ten_pay_trans_fer_confirm

参数类型必填说明
wxidstring是转账发送方wxid
transIdstring是转账交易ID
json
{"wxid": "wxid_xxx", "transId": "1000050001202408161428438482833"}

基于 MIT 许可发布