聊天消息
<p><strong>简要描述:</strong></p>
<ul>
<li>监听聊天消息【需要自己开一个HTTP服务,DLL会主动请求你,并把消息内容推送到约定接口】</li>
</ul>
<p><strong>请求URL:</strong></p>
<ul>
<li><code>http://127.0.0.1:9000/msg</code></li>
</ul>
<p><strong>请求方式:</strong></p>
<ul>
<li>POST</li>
</ul>
<p><strong>消息示例:</strong></p>
<pre><code class="language-json">{
&quot;type&quot;: 100, // 推送类型,固定为100
&quot;msg_type&quot;: 2, //消息类型
&quot;msg_id&quot;: &quot;10018000&quot;, //消息ID
&quot;user_id&quot;: &quot;7881300000&quot;, //聊天用户ID/群ID,
&quot;waiter_id&quot;: &quot;2580800000&quot;, //客服ID
&quot;at_list&quot;: [&quot;7881300001&quot;, &quot;7881300002&quot;], // 群消息艾特人列表,艾特所有人就是【notify@all】
&quot;content&quot;: &quot;不同类型的消息,该字段的值也不相同,具体看下方文档&quot;, //消息内容【可变字段】
&quot;sender&quot;: &quot;7881300003&quot;, //如果是群消息,该参数为发送者的用户ID,否则为空
&quot;time_stamp&quot;: 1682944354, //发送时间
&quot;is_self_msg&quot;: 1, //是否是自己发送的消息 0:别人发来的 1:自己发的
&quot;is_pc_msg&quot;: 1, //是否是PC端发送的消息(仅用于判断自己发送的消息,别人发送的都是0) 0:否 1:是
&quot;self_user_id&quot;: &quot;168888888888&quot;, //自己的用户ID
&quot;port&quot;: 8989 //DLL的端口号
}</code></pre>
<p><strong>消息类型说明【msg_type】:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: center;">消息类型</th>
<th style="text-align: center;">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">2</td>
<td style="text-align: center;">文本消息</td>
</tr>
<tr>
<td style="text-align: center;">14</td>
<td style="text-align: center;">图片消息</td>
</tr>
<tr>
<td style="text-align: center;">29</td>
<td style="text-align: center;">GIF消息</td>
</tr>
<tr>
<td style="text-align: center;">15</td>
<td style="text-align: center;">文件消息</td>
</tr>
<tr>
<td style="text-align: center;">23</td>
<td style="text-align: center;">视频消息</td>
</tr>
<tr>
<td style="text-align: center;">41</td>
<td style="text-align: center;">名片消息</td>
</tr>
<tr>
<td style="text-align: center;">78</td>
<td style="text-align: center;">小程序消息</td>
</tr>
<tr>
<td style="text-align: center;">141</td>
<td style="text-align: center;">视频号消息</td>
</tr>
<tr>
<td style="text-align: center;">13</td>
<td style="text-align: center;">卡片链接消息</td>
</tr>
<tr>
<td style="text-align: center;">6</td>
<td style="text-align: center;">位置消息</td>
</tr>
<tr>
<td style="text-align: center;">16</td>
<td style="text-align: center;">语音消息</td>
</tr>
<tr>
<td style="text-align: center;">4</td>
<td style="text-align: center;">合并消息</td>
</tr>
<tr>
<td style="text-align: center;">其他不常见的消息可根据 msg_type 自行分析</td>
<td style="text-align: center;">未知消息</td>
</tr>
</tbody>
</table>
<p><strong>【2】文本消息的content:</strong></p>
<pre><code class="language-json">&quot;就是字符串&quot;</code></pre>
<p><strong>【14】图片消息的content:</strong></p>
<pre><code class="language-json">{
&quot;cdn_key&quot;: &quot;30520201000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;aes_key&quot;: &quot;ba8221xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;url&quot;: &quot;&quot;,
&quot;auth_key&quot;: &quot;&quot;,
&quot;md5&quot;: &quot;e12f93xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;size&quot;: 230192, //图片大小
&quot;img_type&quot;: 2, //1=原图 2=高清图 3=缩略图
&quot;source_type&quot;: 2 //资源来源 1:个微 2:企微
}</code></pre>
<p><strong>【29】GIF消息的content:</strong></p>
<pre><code class="language-json">{
&quot;source_type&quot;: 2, //资源来源 1:个微 2:企微
&quot;url&quot;: &quot;http://p.qpic.cn/pic_wework/xxx/xxx/0&quot;
}</code></pre>
<p><strong>【15】文件消息的content:</strong></p>
<pre><code class="language-json">{
&quot;cdn_key&quot;: &quot;30520201000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;aes_key&quot;: &quot;ba8221xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;url&quot;: &quot;&quot;,
&quot;auth_key&quot;: &quot;&quot;,
&quot;md5&quot;: &quot;e12f93xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;size&quot;: 20308, //文件大小
&quot;file_name&quot;: &quot;xxx.exe&quot;, //文件名
&quot;source_type&quot;: 2 //资源来源 1:个微 2:企微
}</code></pre>
<p><strong>【23】视频消息的content:</strong></p>
<pre><code class="language-json">{
&quot;cdn_key&quot;: &quot;30520201000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;aes_key&quot;: &quot;ba8221xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;url&quot;: &quot;&quot;,
&quot;auth_key&quot;: &quot;&quot;,
&quot;md5&quot;: &quot;e12f93xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;size&quot;: 887690, //视频大小
&quot;source_type&quot;: 2 //资源来源 1:个微 2:企微
}</code></pre>
<p><strong>【41】名片消息的content:</strong></p>
<pre><code class="language-json">{
&quot;corp_id&quot;: &quot;197xxx&quot;, //公司ID
&quot;user_id&quot;: &quot;168xxx&quot;, //用户ID
&quot;avatar_url&quot;: &quot;https://thirdwx.qlogo.cn/mmopen/vi_32/xxx/0&quot;, //头像地址
&quot;nick_name&quot;: &quot;三水君&quot;, //昵称
&quot;title&quot;: &quot;超人俱乐部&quot; //卡片标题
}</code></pre>
<p><strong>【78】小程序消息的content:</strong></p>
<pre><code class="language-json">{
&quot;app_id&quot;: &quot;wx32540bd863b27570&quot;, //小程序ID
&quot;app_name&quot;: &quot;拼夕夕&quot;, //小程序名称
&quot;title&quot;: &quot;快帮我砍一刀~&quot;, //标题
&quot;desc&quot;: &quot;拼单尽享优惠&quot;, //描述信息
&quot;wechat_id&quot;: &quot;gh_0e7477744313@app&quot;, //微信ID
&quot;page_path&quot;: &quot;pages/index/index.html?xxx&quot;, //页面路径
&quot;avatar_url&quot;: &quot;http://mmbiz.qpic.cn/mmbiz_png/xxx/640?wx_fmt=png&amp;wxfrom=200&quot;, //头像地址
&quot;cover_cdn_key&quot;: &quot;30520201000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;cover_aes_key&quot;: &quot;ba8221xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;cover_md5&quot;: &quot;e12f93xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;cover_size&quot;: 887690, //封面文件大小
}</code></pre>
<p><strong>【141】视频号消息的content:</strong></p>
<pre><code class="language-json">{
&quot;avatar_url&quot;: &quot;https://wx.qlogo.cn/finderhead/ver_1/xxx/0&quot;, //头像地址
&quot;cover_url&quot;: &quot;http://wxapp.tc.qq.com/251/20304/stodownload?xxx&quot;, //封面地址
&quot;video_url&quot;: &quot;https://channels.weixin.qq.com/web/pages/feed?eid=xxx&quot;, //视频地址
&quot;desc&quot;: &quot;KOC运营效果差?关键做好这两点#企业微信&quot;, //描述信息
&quot;extras&quot;: &quot;CAEQACKxHAAE9Omxxx&quot;, //未知字符串
&quot;nick_name&quot;: &quot;企业微信拍了拍你&quot;, //昵称
&quot;thumb_url&quot;: &quot;http://wxapp.tc.qq.com/251/20304/stodownload?xxxxx&quot; //缩略图地址
}</code></pre>
<p><strong>【13】卡片链接消息的content:</strong></p>
<pre><code class="language-json">{
&quot;title&quot;: &quot;我是标题&quot;, //标题
&quot;desc&quot;: &quot;我是描述信息&quot;, //描述信息
&quot;cover_url&quot;: &quot;http://img.xxx.com/imgextra/i2/1031524252/xxx.jpg&quot;, //封面地址
&quot;target_url&quot;: &quot;https://www.baidu.com&quot; //目标地址
}</code></pre>
<p><strong>【6】位置消息的content:</strong></p>
<pre><code class="language-json">{
&quot;address&quot;: &quot;北极&quot;, //地址
&quot;detail_address&quot;: &quot;一块冰面上&quot;, //详细地址
&quot;lat&quot;: &quot;0.000000&quot;, //纬度
&quot;lon&quot;: &quot;90.000000&quot; //经度
}</code></pre>
<p><strong>【16】语音消息的content:</strong></p>
<pre><code class="language-json">{
&quot;cdn_key&quot;: &quot;30520201000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;aes_key&quot;: &quot;ba8221xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;md5&quot;: &quot;e12f93xxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
&quot;size&quot;: 3997, //语音文件大小
&quot;voice_time&quot;: 3 //语音时长
}</code></pre>