Skip to content

Instantly share code, notes, and snippets.

@suanmiao
Created June 13, 2014 15:58
Show Gist options
  • Save suanmiao/c79bd273dab9f8514aaa to your computer and use it in GitHub Desktop.
Save suanmiao/c79bd273dab9f8514aaa to your computer and use it in GitHub Desktop.
WeChat Hack API

#Wechat Hack API


###1.Reply

  • ####Url:

https://mp.weixin.qq.com/cgi-bin/singlesend


* ####Headers:


* ####Params:

   |key|value|explain|
| ------- | --- |
| mask | false |默认|
|tofakeid|517884615|对方fadeId|
|imgcode| |默认|
|type|1|默认|
|content|hahaha|回复内容|
|quickreplyid|200110910|消息id|
|token|652707118||
|lang|zh_CN|
|random|0.9770433397497982|
|f|json||
|ajax | 1 ||
|t|ajax-response||

###2.ImgCode

* ####Url:

https://mp.weixin.qq.com/cgi-bin/verifycode

* ####Method:
 POST

* ####Params:
|key|value|explain|
| ------- | 
|username|redbot|用户名|
|r|1402042299313|随机数|


* ####Extra:

1.需要从response的cookie里获取sig,进行登录操作时需要把sig放入header中
2.


###3.Login

* ####Extra:
 

{"ret":-27,"err_msg":"wrong verify code"} {"ret":-23,"err_msg":"acct/password error"} {"ret":-8,"err_msg":"need verify code"}



###4.GetHeadImg


###5.Star

* ####Url:

https://mp.weixin.qq.com/cgi-bin/setstarmessage

* ####Method:
 POST
 
* ####Params:

 |Key|Value|
 |---|---|
 |msgid|200115568|
 |value|1|
|token|112643800|
|lang|zh_CN|
|random|0.8881410148460418|
|f|json|
|ajax|1|
|t|ajax-setstarmessage|

* ####Response:

{ "ret":0, "msg":"sys ok"}






###6.Quick Reply

* ####Url:

https://mp.weixin.qq.com/cgi-bin/singlesend

* ####Method:
 POST
 
* ####Header:
Cookie: sig=h01891a676c61621dc8b3b9eb034f191022ae49c16210df61d2fe01a4edbbfad1720753a89d9a0d295c; slave_user=gh_12a1412f3492; slave_sid=anUxaW5ObV9pZU55R0VXMGpFUDRjN2x2eExkMEtaRXpxYmxaX2tpYXFuR3Vya21uaFNoRHFvSnJnWlNIZzB1cDZvNVdqcTBXZDZCX2J1TDJkSUJhcUFZNzRSdGhTZ1FReVJGWThrbkZENElPNGpzME9tZzh5aGNlb1BoOWppNEg=;

 Referer:https://mp.weixin.qq.com/cgi-bin/message?t=message/list&count=20&day=7&token=112643800&lang=zh_CN

 User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

 X-Requested-With:XMLHttpRequest

* ####Params:

 |Key|Value|
 |---|---|
|mask|false|
|tofakeid|517884615|
|imgcode||
|type|1|
|content|test|
|quickreplyid|200115568|
|token|112643800|
|lang|zh_CN|
|random|0.5433272225782275|
|f|json|
|ajax|1|
|t|ajax-response|

* ####Response:

{"base_resp":{"ret":0,"err_msg":"ok"}}





###7.SingleChat

* ####Url:

https://mp.weixin.qq.com/cgi-bin/singlesend

* ####Method:
 POST
 
* ####Header:
。。。

* ####Params:

 |Key|Value|Explain|
 |---|---|--|
|type|1|消息类型,1为文本|
|content|哈哈哈哈哈|
|tofakeid|355421075|
|imgcode||
|token|1193207102|
|lang|zh_CN|
|random|0.805671624140814|
|f|json|
|ajax|1|
|t|ajax-response|


* ####Response:

成功: {"base_resp":{"ret":0,"err_msg":"ok"}}

48小时未回复: {"base_resp":{"ret":10706,"err_msg":"customer block"}}






###8.RefreshChat

* ####Url:

https://mp.weixin.qq.com/cgi-bin/singlesendpage

* ####Method:
 GET
 
* ####Header:
。。。

* ####Params:

 |Key|Value|Explain|
 |---|---|--|
|token|90450993||
|lang|zh_CN||
|random|0.3425433235242963||
|f|json||
|ajax|1||
|tofakeid|355421075|发送到fakeid|
|action|sync||
|lastmsgfromfakeid|355421075|对方的fakeid|
|lastmsgid|200118808||
|createtime|1402475477|时间戳|

* ####Response:

{"base_resp":{"ret":0,"err_msg":"ok"},"page_info":{"to_nick_name":"蒜苗白菜","msg_items":{"msg_item":[{"id":200120701,"type":1,"fakeid":"355421075","nick_name":"蒜苗白菜","date_time":1402542291,"content":"hoho咯lz","source":"","msg_status":4,"remark_name":"哈哈","has_reply":0,"refuse_reason":"","multi_item":[],"to_uin":2390620320,"send_stat":{"total":0,"succ":0,"fail":0}},{"id":200120700,"type":1,"fakeid":"355421075","nick_name":"蒜苗白菜","date_time":1402542281,"content":"啊啊啊啊","source":"","msg_status":4,"remark_name":"哈哈","has_reply":0,"refuse_reason":"","multi_item":[],"to_uin":2390620320,"send_stat":{"total":0,"succ":0,"fail":0}}]}}}

结构: 1.base_resp,状态标识 2.page_info,内容标识



###9.GetNewMsgCount

* ####Url:
* ####Method:
 POST
 
* ####Header:
。。。

* ####Params:

 |Key|Value|Explain|
 |---|---|--|
|token|90450993||
|lang|zh_CN||
|random|0.3425433235242963||

* ####Response:

成功: ret:0 ret=-2000:request denied



###10.Edit User Group

* ####Url:

https://mp.weixin.qq.com/cgi-bin/modifycontacts

* ####Method:
 POST
 
* ####Header:
。。。

* ####Params:

 |Key|Value|Explain|
 |---|---|--|
|contacttype|2
|tofakeidlist|266403760
|token|1553323490
|lang|zh_CN
|random|0.33905161218717694
|f|json
|ajax|1
|action|modifycontacts
|t|ajax-putinto-group

* ####Response:










Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment