获取群聊消息接口传递参数
提交方式:POST
数据格式:Content-Type: application/json
提交时间:有群消息产生时
注意:所有可能输入汉字的地方,都可能会出现emoji表情,需要数据库编码支持,或者程序进行utf8转码,包括各类昵称,聊天消息内容
1、纯文字消息
~~~
{
"msgdata":{ //消息内容数据
"MsgId":"5349604074085380297", //消息ID,唯一
"FromUserName":"@@51ffe74f0632511393baecafb108811e8bd9fcc73267e50a345beca602e57604", //群临时ID
"ToUserName":"@366cf248742d012326393a856160e6bf6517a086a031c7ce5ed8d1f353a3312e", //消息接收人临时ID
"MsgType":1, //消息类型,1=文本
"Content":"活着的意义就是折腾", //消息内容
"Status":3,
"ImgStatus":1,
"CreateTime":1489744679, //消息发送时间
"VoiceLength":0,
"PlayLength":0,
"FileName":"",
"FileSize":"",
"MediaId":"",
"Url":"",
"AppMsgType":0,
"StatusNotifyCode":0,
"StatusNotifyUserName":"",
"RecommendInfo":{
"UserName":"",
"NickName":"",
"QQNum":0,
"Province":"",
"City":"",
"Content":"",
"Signature":"",
"Alias":"",
"Scene":0,
"VerifyFlag":0,
"AttrStatus":0,
"Sex":0,
"Ticket":"",
"OpCode":0
},
"ForwardFlag":0,
"AppInfo":{
"AppID":"",
"Type":0
},
"HasProductId":0,
"Ticket":"",
"ImgHeight":0,
"ImgWidth":0,
"SubMsgType":0,
"NewMsgId":5349604074085380000, //加密的消息ID
"OriContent":"",
"ActualUserName":"@fbbc65dcd19fbb1450ab99e01dc3ded5", //群消息发送人临时ID
"ActualNickName":"小红", //群消息发送人的群昵称,没有设置昵称为原昵称
"isAt":false, //是否@我,true=@我
"Type":"Text", //消息类型的文本表示
"Text":"活着的意义就是折腾" //消息的纯文本内容,过滤掉emoji表情等特殊符号
},
"msgchat":{//消息所在群数据
"MemberCount":51, //群成员人数
"NickName":"三年二班", //群名称
"UserName":"@@51ffe74f0632511393baecafb108811e8bd9fcc73267e50a345beca602e57604", //群临时ID
"RemarkName":""
},
"msgmember":{ //群消息发送人
"Uin":0,
"UserName":"@fbbc65dcd19fbb1450ab99e01dc3ded5", //群消息发送人临时ID
"NickName":"小红", //群消息发送人昵称
"AttrStatus":110823, //群聊识别代码
"PYInitial":"",
"PYQuanPin":"",
"RemarkPYInitial":"",
"RemarkPYQuanPin":"",
"MemberStatus":0,
"DisplayName":"王小红", //群消息发送人的群昵称
"KeyWord":"wxy"
}
}
~~~
2、图片消息(图片与消息数据分开上传)
~~~
{
"msgdata":{ //消息内容数据
"MsgId":"6605200808243915066", //消息ID,唯一
"FromUserName":"@@fcacbc7ef44be0b118fcc3e3d8f312f435b0aa7ed76500a8d39ae1b631be02db", //群临时ID
"ToUserName":"@581affebfdf5c0878323332f1345b9aebd033cfc19146f21e517c2e5bb02c918", //消息接收人临时ID
"MsgType":3, //消息类型,3=图片
"Content":"", //消息发送内容
"Status":3,
"ImgStatus":2,
"CreateTime":1489760145, //消息发送时间
"VoiceLength":0,
"PlayLength":0,
"FileName":"170317-221842.png", //图片名称
"FileSize":"",
"MediaId":"",
"Url":"",
"AppMsgType":0,
"StatusNotifyCode":0,
"StatusNotifyUserName":"",
"RecommendInfo":{
"UserName":"",
"NickName":"",
"QQNum":0,
"Province":"",
"City":"",
"Content":"",
"Signature":"",
"Alias":"",
"Scene":0,
"VerifyFlag":0,
"AttrStatus":0,
"Sex":0,
"Ticket":"",
"OpCode":0
},
"ForwardFlag":0,
"AppInfo":{
"AppID":"",
"Type":0
},
"HasProductId":0,
"Ticket":"",
"ImgHeight":120,
"ImgWidth":68,
"SubMsgType":0,
"NewMsgId":6605200808243915000, //加密的消息ID
"OriContent":"",
"ActualUserName":"@fbbc65dcd19fbb1450ab99e01dc3ded5", //群消息发送人临时ID
"ActualNickName":"小红", //群消息发送人的群昵称,没有设置昵称为原昵称
"isAt":false,
"Type":"Picture", //消息类型的文本表示
"Text":""
},
"msgchat":{//消息所在群数据
"MemberCount":51, //群成员人数
"NickName":"三年二班", //群名称
"UserName":"@@51ffe74f0632511393baecafb108811e8bd9fcc73267e50a345beca602e57604", //群临时ID
"RemarkName":""
},
"msgmember":{ //群消息发送人
"Uin":0,
"UserName":"@fbbc65dcd19fbb1450ab99e01dc3ded5", //群消息发送人临时ID
"NickName":"小红", //群消息发送人昵称
"AttrStatus":110823, //群聊识别代码
"PYInitial":"",
"PYQuanPin":"",
"RemarkPYInitial":"",
"RemarkPYQuanPin":"",
"MemberStatus":0,
"DisplayName":"王小红", //群消息发送人的群昵称
"KeyWord":"wxy"
}
}
~~~
3、群邀请信息
~~~
{
"msgdata":{ //消息内容数据
"MsgId":"4798005844400401060", //消息ID,唯一
"FromUserName":"@27a5594cbc485aacfa1c96b4af307378", //群临时ID
"ToUserName":"@581affebfdf5c0878323332f1345b9aebd033cfc19146f21e517c2e5bb02c918", //消息接收人临时ID
"MsgType":49, //消息类型,49=APP消息,仅限于微信手机端或者电脑客户端打开
"Content":"该类型暂不支持,请在手机上查看", //消息发送内容
"Status":3,
"ImgStatus":0,
"CreateTime":1489763407, //消息发送时间
"VoiceLength":0,
"PlayLength":0,
"FileName":"",
"FileSize":"",
"MediaId":"",
"Url":"",
"AppMsgType":0,
"StatusNotifyCode":0,
"StatusNotifyUserName":"",
"RecommendInfo":{
"UserName":"",
"NickName":"",
"QQNum":0,
"Province":"",
"City":"",
"Content":"",
"Signature":"",
"Alias":"",
"Scene":0,
"VerifyFlag":0,
"AttrStatus":0,
"Sex":0,
"Ticket":"",
"OpCode":0
},
"ForwardFlag":0,
"AppInfo":{
"AppID":"",
"Type":0
},
"HasProductId":0,
"Ticket":"",
"ImgHeight":0,
"ImgWidth":0,
"SubMsgType":0,
"NewMsgId":4798005844400401000, //加密的消息ID
"OriContent":"",
"Type":"Sharing",
"Text":""
},
"msgchat":{//消息所在群数据
"MemberCount":51, //群成员人数
"NickName":"三年二班", //群名称
"UserName":"@@51ffe74f0632511393baecafb108811e8bd9fcc73267e50a345beca602e57604", //群临时ID
"RemarkName":""
},
"msgmember":{ //群消息发送人
"Uin":0,
"UserName":"@fbbc65dcd19fbb1450ab99e01dc3ded5", //群消息发送人临时ID
"NickName":"小红", //群消息发送人昵称
"AttrStatus":110823, //群聊识别代码
"PYInitial":"",
"PYQuanPin":"",
"RemarkPYInitial":"",
"RemarkPYQuanPin":"",
"MemberStatus":0,
"DisplayName":"王小红", //群消息发送人的群昵称
"KeyWord":"wxy"
}
}
~~~
接口返回参数格式:JSON
~~~
{
"code":200, //状态码
"msg":'信息保存成功' //提示信息
}
~~~