golang开发之个微机器人的二次开发

2023-12-13 05:21:35

简要描述:

  • 下载消息中的文件

请求URL:

请求方式:

  • POST

请求头Headers:

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

参数:

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

返回数据:

参数名类型说明
codestring1000成功,1001失败
msgstring反馈信息

请求参数示例

<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/

?

文章来源:https://blog.csdn.net/2302_77913771/article/details/134811927
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。