Secondary development of a microrobot developed by go

A brief description:

  • Download voices in messages

Request URL:

  • http://域名地址/getMsgVoice

Request method:

  • POST

Request headers:

  • Content-Type:application/json
  • Authorization: login interface returns

parameter:

parameter name required type illustrate
wId yes string Login instance ID Contains this parameter All parameters are taken from the message callback)
msgId yes long message id
length yes int Voice length (length field in xml data)
bufId yes string bufId field value returned in xml
fromUser yes string sender

Return data:

parameter name type illustrate
code string 1000 success, 1001 failure
msg string Feedback

Request parameter example

<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">"24a929b2-016d-4932-b93f-ff1b0a800305"</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">1114311129</span><span style="color:#999999">,</span>
    <span style="color:#990055">"fromUser"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"zhongweiyu789"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"bufId"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"289139440622895483"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"length"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span><span style="color:#990055">3227</span>
<span style="color:#999999">}</span></code></span></span></span></span>

Successful return example

<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">"https://weikong-1301028514.cos.ap-shanghai.myqcloud.com//msgImg/e2045467-b1ac-4b3c-89f8-62ab2b3a2284-1591351192235-300000.silk"</span>
    <span style="color:#999999">}</span>
<span style="color:#999999">}</span></code></span></span></span></span>

Error return example

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

Test address: https://wkteam.cn/

 

Guess you like

Origin blog.csdn.net/2302_77913771/article/details/134737774