{
"username": "test",
"password": "test
}
{
"code": 200,
"token": "xxxxxxxxxx",
"expire": 3600
}
- 200: ok
- -1: invaild input
- -2: mismatch username or password
- -999: server error
客户端每 5s 回报一次,其中包含:
{
"id": 123,
"body": [
{
"botId": 1,
"type": "newmessage",
"message": "test message"
},
{
"botId": 1,
"type": "newcontact",
"wxid": "testid",
"name": "testuser",
"message": "test message"
}
]
}
{
"code": 200,
"online": [
1, 2, 3
],
"offline": [
4, 5, 6
],
"body": [
{
"botId": 1,
"type": "sendmessage",
"toWxId": "testId",
"message": "test message"
},
{
"botId": 1,
"type": "newcontact",
"wxId": "testId",
"accept": true
}
]
}
添加新的机器人账号
{
"wxId": "testId",
"name": "testaccount",
"info": "the first wechat bot"
}
{
"code": 200,
"botId": 2
}