go开发之个人微信号机器人开发

简要描述:

  • 下载消息中的文件

请求URL:

请求方式:

  • POST

请求头Headers:

  • Content-Type:application/json
  • Authorization:login接口返回

参数:

参数名 必选 类型 说明
wId string 登录实例标识 包含此参数 所有参数都是从消息回调中取)
msgId long 消息id
content string 收到的消息的xml数据

返回数据:

参数名 类型 说明
code string 1000成功,1001失败
msg string 反馈信息

请求参数示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
   <span style="color:#990055">"wId"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"0000016f-a3f4-7ac2-0001-4686486bb6c6"</span><span style="color:#999999">,</span>
   <span style="color:#990055">"msgId"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#990055">1102684150</span><span style="color:#999999">,</span>
   <span style="color:#990055">"content"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"<?xml version=\"1.0\"?><msg><appmsg appid=\"wx6618f1cfc6c132f8\" sdkver=\"0\"><title>下载文件.txt</title><des /><action>view</action><type>6</type><showtype>0</showtype><content /><url /><dataurl /><lowurl /><lowdataurl /><recorditem><![CDATA[]]></recorditem><thumburl /><messageaction /><extinfo /><sourceusername /><sourcedisplayname /><commenturl /><appattach><totallen>6</totallen><attachid>@cdn_304e02010004473045020100020466883f5202032f55f90204260260b402045e1db470042036626464393436656537643431613836623065383665373034396538646566630204010400050201000400_17dd9d048f84c77db909b2161d6dbb09_1</attachid><emoticonmd5></emoticonmd5><fileext>txt</fileext><cdnattachurl>304e02010004473045020100020466883f5202032f55f90204260260b402045e1db470042036626464393436656537643431613836623065383665373034396538646566630204010400050201000400</cdnattachurl><aeskey>17dd9d048f84c77db909b2161d6dbb09</aeskey><encryver>1</encryver></appattach><weappinfo><pagepath /><username /><appid /><appservicetype>0</appservicetype></weappinfo><websearch /><md5>8c8fa3529ee34d4e69a0baafb7069da3</md5></appmsg><fromusername>wxid_lr6j4nononb921</fromusername><scene>0</scene><appinfo><version>7</version><appname>微信电脑版</appname></appinfo><commenturl /></msg>"</span>
<span style="color:#999999">}</span></code></span></span></span></span>

成功返回示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
    <span style="color:#990055">"message"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"成功"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"code"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"1000"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"data"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#999999">{</span>
        <span style="color:#990055">"url"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"下载文件.txt"</span>
    <span style="color:#999999">}</span>
<span style="color:#999999">}</span></code></span></span></span></span>

错误返回示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
    <span style="color:#990055">"message"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"失败"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"code"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"1001"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"data"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#0077aa">null</span>
<span style="color:#999999">}</span></code></span></span></span></span>

测试地址:https://wkteam.cn/

 

相关推荐

  1. go-zero 开发安装 etcd

    2023-12-05 23:22:04       61 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-05 23:22:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-05 23:22:04       101 阅读
  3. 在Django里面运行非项目文件

    2023-12-05 23:22:04       82 阅读
  4. Python语言-面向对象

    2023-12-05 23:22:04       91 阅读

热门阅读

  1. error转string

    2023-12-05 23:22:04       51 阅读
  2. SpringMVC消息转换器 对日期类型进行统一格式化

    2023-12-05 23:22:04       51 阅读
  3. Golang WebSocket 心跳

    2023-12-05 23:22:04       58 阅读
  4. 在Spring Boot中配置@Async的线程池的拒绝策略

    2023-12-05 23:22:04       56 阅读
  5. Spring Boot 最核心的 25 个注解

    2023-12-05 23:22:04       49 阅读
  6. Cpp之旅(学习笔记)第10章 字符串和正则表达式

    2023-12-05 23:22:04       47 阅读
  7. 说说过量 tcp pure ack 的利弊

    2023-12-05 23:22:04       55 阅读
  8. React 基础使用

    2023-12-05 23:22:04       57 阅读
  9. ElasticSearch之Delete index API

    2023-12-05 23:22:04       67 阅读
  10. SpringBoot学习笔记-实现微服务:匹配系统(中)

    2023-12-05 23:22:04       49 阅读
  11. Python【匹配符号】

    2023-12-05 23:22:04       54 阅读