mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-22 18:29:23 +08:00
462 lines
11 KiB
Markdown
462 lines
11 KiB
Markdown
|
|
|||
|
|
|||
|
## 3.9.7.29版本,http接口文档,文档仅供参考。
|
|||
|
|
|||
|
### 简单说明:
|
|||
|
所有接口只支持post方法。
|
|||
|
全部使用json格式。
|
|||
|
格式: http://host:port/api/xxxx
|
|||
|
host: 绑定的host
|
|||
|
port: 监听的端口
|
|||
|
xxxx: 对应的功能路径
|
|||
|
返回结构的json格式:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"data": {},
|
|||
|
"msg": "success"
|
|||
|
}
|
|||
|
```
|
|||
|
code: 错误码
|
|||
|
msg: 成功/错误信息
|
|||
|
data: 接口返回的数据
|
|||
|
|
|||
|
|
|||
|
接口与3.9.5.81基本无变化,优化了httpclient连接。
|
|||
|
config.ini 配置文件可以配置http服务端口和隐藏dll
|
|||
|
```
|
|||
|
Port=19088
|
|||
|
HiddenDll=0 //1隐藏 0不隐藏
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
|
|||
|
#### 0.检查微信登录**
|
|||
|
###### 接口功能
|
|||
|
> 检查微信是否登录
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/checkLogin](/api/checkLogin)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,1 成功, 0失败|
|
|||
|
|result|string|成功提示|
|
|||
|
|data|string|响应内容|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"msg": "success",
|
|||
|
"data":null
|
|||
|
}
|
|||
|
```
|
|||
|
|
|||
|
#### 1.获取登录用户信息**
|
|||
|
###### 接口功能
|
|||
|
> 获取登录用户信息
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/userInfo](/api/userInfo)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,1 成功, 0失败|
|
|||
|
|result|string|成功提示|
|
|||
|
|data|object|响应内容|
|
|||
|
|  account|string|账号|
|
|||
|
|  headImage|string|头像|
|
|||
|
|  city|string|城市|
|
|||
|
|  country|string|国家|
|
|||
|
|  currentDataPath|string|当前数据目录,登录的账号目录|
|
|||
|
|  dataSavePath|string|微信保存目录|
|
|||
|
|  mobile|string|手机|
|
|||
|
|  name|string|昵称|
|
|||
|
|  province|string|省|
|
|||
|
|  wxid|string|wxid|
|
|||
|
|  signature|string|个人签名|
|
|||
|
|  dbKey|string|数据库的SQLCipher的加密key,可以使用该key配合decrypt.py解密数据库
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"data": {
|
|||
|
"account": "xxx",
|
|||
|
"city": "Zhengzhou",
|
|||
|
"country": "CN",
|
|||
|
"currentDataPath": "C:\\WeChat Files\\wxid_xxx\\",
|
|||
|
"dataSavePath": "C:\\wechatDir\\WeChat Files\\",
|
|||
|
"dbKey": "965715e30e474da09250cb5aa047e3940ffa1c8f767c4263b132bb512933db49",
|
|||
|
"headImage": "https://wx.qlogo.cn/mmhead/ver_1/MiblV0loY0GILewQ4u2121",
|
|||
|
"mobile": "13949175447",
|
|||
|
"name": "xxx",
|
|||
|
"province": "Henan",
|
|||
|
"signature": "xxx",
|
|||
|
"wxid": "wxid_22222"
|
|||
|
},
|
|||
|
"msg": "success"
|
|||
|
}
|
|||
|
```
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#### 2.发送文本消息**
|
|||
|
###### 接口功能
|
|||
|
> 发送文本消息
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/sendTextMsg](/api/sendTextMsg)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|wxid |true |string| 接收人wxid |
|
|||
|
|msg|true |string|消息文本内容|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,不为0成功, 0失败|
|
|||
|
|msg|string|成功提示|
|
|||
|
|data|object|null|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"wxid": "filehelper",
|
|||
|
"msg": "1112222"
|
|||
|
}
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{"code":345686720,"msg":"success","data":null}
|
|||
|
```
|
|||
|
|
|||
|
#### 3.hook消息**
|
|||
|
###### 接口功能
|
|||
|
> hook接收文本消息,图片消息,群消息.该接口将hook的消息通过tcp回传给本地的端口。
|
|||
|
enableHttp=1时,使用url,timeout参数配置服务端的接收地址。请求为post,Content-Type 为json。
|
|||
|
enableHttp=0时,使用ip,port的tcp服务回传消息。
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/hookSyncMsg](/api/hookSyncMsg)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|port |true |string| 本地服务端端口,用来接收消息内容 |
|
|||
|
|ip |true |string| 服务端ip地址,用来接收消息内容,可以是任意ip,即tcp客户端连接的服务端的ip|
|
|||
|
|url |true |string| http的请求地址,enableHttp=1时,不能为空 |
|
|||
|
|timeout |true |string| 超时时间,单位ms|
|
|||
|
|enableHttp |true |number| 0/1 :1.启用http 0.不启用http|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,0成功, 非0失败|
|
|||
|
|data|object|null|
|
|||
|
|msg|string|成功提示|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"port": "19099",
|
|||
|
"ip":"127.0.0.1",
|
|||
|
"url":"http://localhost:8080",
|
|||
|
"timeout":"3000",
|
|||
|
"enableHttp":"0"
|
|||
|
}
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{"code":0,"msg":"success","data":null}
|
|||
|
```
|
|||
|
|
|||
|
#### 4.取消hook消息**
|
|||
|
###### 接口功能
|
|||
|
> 取消hook消息
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/unhookSyncMsg](/api/unhookSyncMsg)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,0成功, 非0失败|
|
|||
|
|data|object|null|
|
|||
|
|msg|string|成功提示|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{"code":0,"msg":"success","data":null}
|
|||
|
```
|
|||
|
|
|||
|
#### 5.好友列表**
|
|||
|
###### 接口功能
|
|||
|
> 好友列表
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/getContactList](/api/getContactList)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,0成功, 非0失败|
|
|||
|
|data|object|好友信息|
|
|||
|
|  customAccount|string|自定义账号|
|
|||
|
|  encryptName|string|昵称|
|
|||
|
|  nickname|string|昵称|
|
|||
|
|  pinyin|string|简拼|
|
|||
|
|  pinyinAll|string|全拼|
|
|||
|
|  reserved1|number|未知|
|
|||
|
|  reserved2|number|未知|
|
|||
|
|  type|number|未知|
|
|||
|
|  verifyFlag|number|未知|
|
|||
|
|  wxid|string|wxid|
|
|||
|
|msg|string|成功提示|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"data": [
|
|||
|
{
|
|||
|
"customAccount": "",
|
|||
|
"encryptName": "v3_020b3826fd03010000000000e04128fddf4d90000000501ea9a3dba12f95f6b60a0536a1adb6b40fc4086288f46c0b89e6c4eb8062bb1661b4b6fbab708dc4f89d543d7ade135b2be74c14b9cfe3accef377b9@stranger",
|
|||
|
"nickname": "文件传输助手",
|
|||
|
"pinyin": "WJCSZS",
|
|||
|
"pinyinAll": "wenjianchuanshuzhushou",
|
|||
|
"reserved1": 1,
|
|||
|
"reserved2": 1,
|
|||
|
"type": 3,
|
|||
|
"verifyFlag": 0,
|
|||
|
"wxid": "filehelper"
|
|||
|
}
|
|||
|
].
|
|||
|
"msg": "success"
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
#### 6.获取数据库信息**
|
|||
|
###### 接口功能
|
|||
|
> 获取数据库信息和句柄
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/getDBInfo](/api/getDBInfo)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,0成功, 非0失败|
|
|||
|
|msg|string|返回信息|
|
|||
|
|data|array|好友信息|
|
|||
|
|  databaseName|string|数据库名称|
|
|||
|
|  handle|number|句柄|
|
|||
|
|  tables|array|表信息|
|
|||
|
|    name|string|表名|
|
|||
|
|    rootpage|string|rootpage|
|
|||
|
|    sql|string|ddl语句|
|
|||
|
|    tableName|string|表名|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"data": [
|
|||
|
{
|
|||
|
"databaseName": "MicroMsg.db",
|
|||
|
"handle": 1755003930784,
|
|||
|
"tables": [
|
|||
|
{
|
|||
|
"name": "Contact",
|
|||
|
"rootpage": "2",
|
|||
|
"sql": "CREATE TABLE Contact(UserName TEXT PRIMARY KEY ,Alias TEXT,EncryptUserName TEXT,DelFlag INTEGER DEFAULT 0,Type INTEGER DEFAULT 0,VerifyFlag INTEGER DEFAULT 0,Reserved1 INTEGER DEFAULT 0,Reserved2 INTEGER DEFAULT 0,Reserved3 TEXT,Reserved4 TEXT,Remark TEXT,NickName TEXT,LabelIDList TEXT,DomainList TEXT,ChatRoomType int,PYInitial TEXT,QuanPin TEXT,RemarkPYInitial TEXT,RemarkQuanPin TEXT,BigHeadImgUrl TEXT,SmallHeadImgUrl TEXT,HeadImgMd5 TEXT,ChatRoomNotify INTEGER DEFAULT 0,Reserved5 INTEGER DEFAULT 0,Reserved6 TEXT,Reserved7 TEXT,ExtraBuf BLOB,Reserved8 INTEGER DEFAULT 0,Reserved9 INTEGER DEFAULT 0,Reserved10 TEXT,Reserved11 TEXT)",
|
|||
|
"tableName": "Contact"
|
|||
|
}
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"msg":"success"
|
|||
|
}
|
|||
|
```
|
|||
|
|
|||
|
|
|||
|
#### 7.查询数据库**
|
|||
|
###### 接口功能
|
|||
|
> 查询数据库
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/execSql](/api/execSql)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|dbHandle |true |number| |
|
|||
|
|sql |true |string| 执行的sql |
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,0成功, 非0失败|
|
|||
|
|msg|string|返回信息|
|
|||
|
|data|array|sqlite返回的结果|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"dbHandle":2006119800400,
|
|||
|
"sql":"select * from MSG where localId =301;"
|
|||
|
}
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"data": [
|
|||
|
[
|
|||
|
"localId",
|
|||
|
"TalkerId",
|
|||
|
"MsgSvrID",
|
|||
|
"Type",
|
|||
|
"SubType",
|
|||
|
"IsSender",
|
|||
|
"CreateTime",
|
|||
|
"Sequence",
|
|||
|
"StatusEx",
|
|||
|
"FlagEx",
|
|||
|
"Status",
|
|||
|
"MsgServerSeq",
|
|||
|
"MsgSequence",
|
|||
|
"StrTalker",
|
|||
|
"StrContent",
|
|||
|
"DisplayContent",
|
|||
|
"Reserved0",
|
|||
|
"Reserved1",
|
|||
|
"Reserved2",
|
|||
|
"Reserved3",
|
|||
|
"Reserved4",
|
|||
|
"Reserved5",
|
|||
|
"Reserved6",
|
|||
|
"CompressContent",
|
|||
|
"BytesExtra",
|
|||
|
"BytesTrans"
|
|||
|
],
|
|||
|
[
|
|||
|
"301",
|
|||
|
"1",
|
|||
|
"8824834301214701891",
|
|||
|
"1",
|
|||
|
"0",
|
|||
|
"0",
|
|||
|
"1685401473",
|
|||
|
"1685401473000",
|
|||
|
"0",
|
|||
|
"0",
|
|||
|
"2",
|
|||
|
"1",
|
|||
|
"795781866",
|
|||
|
"wxid_123",
|
|||
|
"testtest",
|
|||
|
"",
|
|||
|
"0",
|
|||
|
"2",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"CgQIEBAAGo0BCAcSiAE8bXNnc291cmNlPJPHNpZ25hdHVyZT52MV9wd12bTZyRzwvc2lnbmF0dXJPgoJPHRtcF9ub2RlPgoJCTxwsaXNoZXItaWQ+Jmx0OyFbQ0RBVEFbXV0mZ3Q7PC9wdWJsaXNoZXItaWQ+Cgk8L3RtcF9ub2RlPgo8L21zZ3NvdXJjZT4KGiQIAhIgNDE1MDA0NjRhZTRmMjk2NjhjMzY2ZjFkOTdmMjAwNDg=",
|
|||
|
""
|
|||
|
]
|
|||
|
],
|
|||
|
"msg": "success"
|
|||
|
}
|
|||
|
```
|