《微信機(jī)器人開發(fā)必備:微信Web協(xié)議大全(3)》要點(diǎn):
本文介紹了微信機(jī)器人開發(fā)必備:微信Web協(xié)議大全(3),希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
相關(guān)主題:web微信和微信機(jī)器人
僅用于統(tǒng)計(jì)
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxstatreport?fun=new&lang=zh_CN
header Content-Type:application/json;charset=UTF-8
content
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsg?lang=zh_CN&pass_ticket=tM909DkHH8fXLR7hhwIgn9MqmSuCxx6%252BcdaA9qE203zxP7fMT%252FtxPlY7opbnnVE2
lang zh_CN
pass_ticket 登錄后返回信息中獲取
header Content-Type:application/json;charset=UTF-8
content
{
"BaseRequest":{
"Uin":566148615,
"Sid":"2qui+CC4YTiiI2zk",
"Skey":"@crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0",
"DeviceID":"e784205590563506"
},
"Msg":{
"Type":1,
"Content":"@啊啊啊 啊啊啊啊啊啊",
"FromUserName":"@595d9f44c64e2f480baa0d6430ca58ef053a768daa6d7b3fcc4bece244bcbce3",
"ToUserName":"@@9e1c0ab62b5ab222835786c00192fb1e10c75f8082c245d360ac6a6bd2efe2df",
"LocalID":"14766146756340722",
"ClientMsgId":"14766146756340722"
},
"Scene":0
}
Type:1(文字消息),
Content:要發(fā)送的消息,
FromUserName:自己ID,
ToUserName:好友ID,
LocalID:與clientMsgId相同,
ClientMsgId:時(shí)間戳左移4位隨后補(bǔ)上4位隨機(jī)數(shù)
{
"BaseResponse":{
"Ret":0,
"ErrMsg":""
},
"MsgID":"4527210051674039705",
"LocalID":"14766146756340722"
}
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendemoticon?fun=sys&lang=zh_CN
header Content-Type:application/json;charset=UTF-8
content
{
"BaseRequest":{
"Uin":566148615,
"Sid":"2qui+CC4YTiiI2zk",
"Skey":"@crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0",
"DeviceID":"e961665475339031"
},
"Msg":{
"Type":47,
"EmojiFlag":2,
"EMoticonMd5":"44682e637b75a3f5d6747d61dbd23a15",
"FromUserName":"@595d9f44c64e2f480baa0d6430ca58ef053a768daa6d7b3fcc4bece244bcbce3",
"ToUserName":"@e5403f77c2193da671790c1a242d0b43ac6f570e5047993ef745d13d6376b57b",
"LocalID":"14766150190560991",
"ClientMsgId":"14766150190560991"
},
"Scene":0
}
Type:47 emoji消息,
EmojiFlag:2,
MediaId:表情上傳后的媒體ID,
FromUserName:自己ID,
ToUserName:好友ID,
LocalID:與clientMsgId相同,
ClientMsgId:時(shí)間戳左移4位隨后補(bǔ)上4位隨機(jī)數(shù)
{
"BaseResponse":{
"Ret":0,
"ErrMsg":""
},
"MsgID":"1604548346807369725",
"LocalID":"14766150190560991"
}
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsgimg?fun=async&f=json&lang=zh_CN
header Content-Type:application/json;charset=UTF-8
content
{
"BaseRequest":{
"Uin":566148615,
"Sid":"2qui+CC4YTiiI2zk",
"Skey":"@crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0",
"DeviceID":"e374531581999650"
},
"Msg":{
"Type":3,
"MediaId":"@crypt_4d268bd0",
"FromUserName":"@595d9f44c64e2f480baa0d6430ca58ef053a768daa6d7b3fcc4bece244bcbce3",
"ToUserName":"@e5403f77c2193da671790c1a242d0b43ac6f570e5047993ef745d13d6376b57b",
"LocalID":"14766158484990338",
"ClientMsgId":"14766158484990338"
},
"Scene":0
}
Type:3媒體消息,
MediaId:表情上傳后的媒體ID,
FromUserName:自己ID,
ToUserName:好友ID,
LocalID:與clientMsgId相同,
ClientMsgId:時(shí)間戳左移4位隨后補(bǔ)上4位隨機(jī)數(shù)
響應(yīng)
{
"BaseResponse":{
"Ret":0,
"ErrMsg":""
},
"MsgID":"6722400141243782346",
"LocalID":"14766158484990338"
}
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendappmsg?fun=async&f=json
header Content-Type:application/json;charset=UTF-8
content
{
"BaseRequest":{
"Uin":566148615,
"Sid":"NO0RlTCXvpBGaag7",
"Skey":"@crypt_14ae1b12_3bdec7023595f68f9900b5d9d7d30b75",
"DeviceID":"e984332143788024"
},
"Msg":{
"Type":6,
"Content":"<appmsg appid='wxeb7ec651dd0aefa9' sdkver=''><title>top10.csv</title><des></des><action></action><type>6</type><content></content><url></url><lowurl></lowurl><appattach><totallen>1760</totallen><attachid>@crypt_f672a24d_9d9c7d6a3b5ec058db1e6eb3d7c66917ede2e615535e9659365322de110ac41877d9a3b878ed82c0959f9b4602ef6e6d784ae853ab4e242d201cb19b9ee255a337f884eab998c5c43e7d433c01f14c91</attachid><fileext>csv</fileext></appattach><extinfo></extinfo></appmsg>",
"FromUserName":"@257b5aa7fb7b1672afb889be97197478cf618d9bab2b470cf767a61ae9f7f321",
"ToUserName":"@@ab3e18c922f8ab162762f6da231236137ca52871419ec9cafc2421607e82e1ca",
"LocalID":"14767614604200494",
"ClientMsgId":"14767614604200494"
},
"Scene":0
}
響應(yīng)
{
"BaseResponse":{
"Ret":0,
"ErrMsg":""
},
"MsgID":"6923581840474342573",
"LocalID":"14767614604200494"
}
https://file.wx.qq.com/cgi-bin/mmwebwx-bin/webwxuploadmedia?f=json
header Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryoWmrkW7MIGyBhlOt
content
id 文件id
name 文件名
type 文件類型
lastModifieDate 最后修改時(shí)間
size 文件大小
mediatype 文件媒體類型 doc pic
uploadmediarequest(json字符串)
UploadType上傳類型2
BaseRequest
Uin登錄中獲得
Sid登錄中獲得
Skey登錄中獲得
DeviceID設(shè)備id
ClientMediaId文件本地消息id
TotalLen文件總大小
StartPos開始位置
DataLen數(shù)據(jù)長(zhǎng)度
MediaType媒體類型4
FromUserName發(fā)送用戶id
ToUserName接受用戶id
FileMd5文件md5
webwx_data_ticket cookie中信息
pass_ticket
filename 文件流
響應(yīng)
{
"BaseResponse":{
"Ret":0,
"ErrMsg":""
}
,
"MediaId":"@crypt_6084141c_c73c046b750fd6e3e82d0aba4839b89b30851de7eace0446a4f73b524e3b43d41b24048e9c10cf7ba3387d04d63e6bd75bf8e3237acdddda5d4e3ede176617370573ebb2f820595076c55906a50a50a7",
"StartPos":25929,
"CDNThumbImgHeight":0,
"CDNThumbImgWidth":0
}
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetmsgimg?&MsgID=6829659093985341608&skey=%40crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0&type=slave
MsgID:消息ID
type: slave 略縮圖or為空時(shí)加載原圖
skey: xxx
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgeticon?seq=637275253&username=@aa357b7fc1ccb2e77a2632a6251fb6de2c5dd1c0ec503f04b25cfd34c256956a&skey=@crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0
seq:數(shù)字,可為空
username: ID
skey: xxx
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetheadimg?seq=0&username=@@eca74ece82ad7947d262c59d53ab5d001e8776374141377cc025956b44bd1c03&skey=@crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0
seq:數(shù)字,可為空
username:群ID
skey: xxx
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetvoice?msgid=6181125285738858128&skey=@crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0
msgid:消息ID
skey: xxx
https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetvideo?msgid=114757855447263581&skey=%40crypt_14ae1b12_1bb5e370393b8cd502919825fe9dbfc0
msgid:消息ID
skey: xxx
轉(zhuǎn)載請(qǐng)注明本頁網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/14287_3.html