import{_ as t,c as a,a as e,o as n}from"./app-Dgsdh8A6.js";const l={};function d(o,s){return n(),a("div",null,s[0]||(s[0]=[e(`<h1 id="客服消息" tabindex="-1"><a class="header-anchor" href="#客服消息"><span>客服消息</span></a></h1><h2 id="心跳" tabindex="-1"><a class="header-anchor" href="#心跳"><span>心跳</span></a></h2><blockquote><p>https://customerservice.bilibili.com/x/custom/session_svr/v1/heart_beat</p></blockquote><p><em>请求方式: GET</em></p><p>认证方式: Cookie (SESSDATA)</p><p><strong>URL参数:</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>shop_id</td><td>num</td><td>0</td><td>非必要</td><td></td></tr><tr><td>shop_father_id</td><td>num</td><td>0</td><td>非必要</td><td></td></tr><tr><td>build</td><td>num</td><td>客户端版本</td><td>非必要</td><td>web: 0</td></tr><tr><td>mobi_app</td><td>str</td><td>客户端类型</td><td>非必要</td><td>如 <code>web</code></td></tr></tbody></table><p><strong>JSON回复:</strong></p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>code</td><td>num</td><td>返回值</td><td>0: 成功</td></tr><tr><td>msg</td><td>str</td><td><code>ok</code></td><td>失败时不存在</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>成功时为 <code>ok</code></td></tr><tr><td>ttl</td><td>num</td><td>1</td><td></td></tr></tbody></table><p><strong>示例:</strong></p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#569CD6;"> -G</span><span style="color:#CE9178;"> &quot;https://customerservice.bilibili.com/x/custom/session_svr/v1/heart_beat&quot;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-b </span><span style="color:#CE9178;">&quot;SESSDATA=xxx&quot;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><details><summary>查看响应示例:</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;msg&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;ok&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;ok&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></details><h2 id="上传文件" tabindex="-1"><a class="header-anchor" href="#上传文件"><span>上传文件</span></a></h2><blockquote><p>https://customerservice.bilibili.com/x/custom/msg_svr/v1/upload</p></blockquote><p><em>请求方式: POST</em></p><p>认证方式: Cookie (SESSDATA)</p><p>注: 上传的文件 15 分钟内有效, 过期后下载会返回 HTTP 403</p><p><strong>正文参数 (multipart/form-data):</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>file</td><td>file</td><td>文件内容</td><td>必要</td><td></td></tr><tr><td>filename</td><td>str</td><td>文件名</td><td>必要</td><td></td></tr><tr><td>mid</td><td>num</td><td>用户 mid</td><td>必要</td><td></td></tr><tr><td>csrf</td><td>str</td><td>CSRF Token (位于 Cookie 中 bili_jct)</td><td>必要</td><td></td></tr></tbody></table><p><strong>JSON回复:</strong></p><p>根对象:</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>code</td><td>num</td><td>返回值</td><td>0: 成功<br>1000011: 仅支持上传300M内的文件<br>1200201: 获取用户信息失败</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>成功时为 <code>ok</code></td></tr><tr><td>ttl</td><td>num</td><td>1</td><td></td></tr><tr><td>data</td><td>obj</td><td>上传结果</td><td></td></tr></tbody></table><p><code>data</code> 对象:</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>key</td><td>str</td><td>文件名</td><td></td></tr><tr><td>url</td><td>str</td><td>文件 URL</td><td>注意转义</td></tr></tbody></table><p><strong>示例:</strong></p><p>上传文件 <code>./headers/xx-out.xcf</code>, 文件名 <code>ihavenoname</code></p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#569CD6;"> -X</span><span style="color:#CE9178;"> POST</span><span style="color:#CE9178;"> &quot;https://customerservice.bilibili.com/x/custom/msg_svr/v1/upload&quot;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-F </span><span style="color:#CE9178;">&#39;file=@./headers/xx-out.xcf&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-F </span><span style="color:#CE9178;">&#39;filename=ihavenoname&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-F </span><span style="color:#CE9178;">&#39;mid=1070915568&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-F </span><span style="color:#CE9178;">&#39;csrf=xxx&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-b </span><span style="color:#CE9178;">&#39;SESSDATA=xxx; bili_jct=xxx&#39;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><details><summary>查看响应示例:</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;ok&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;data&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;key&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;1a0c88d240852155a111e4cc6893be39.xcf&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;url&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;https://jssz-boss.hdslb.com/customer-video-upload/1a0c88d240852155a111e4cc6893be39.xcf?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=f9TxwsagojnE1DWM%2F20240803%2Fjssz%2Fs3%2Faws4_request&amp;X-Amz-Date=20240803T115447Z&amp;X-Amz-Expires=900&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=cef962c8e503c6ff564fd485bdef1079df1b4a7e38f4fbd9c21a5667207f406e&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">  }</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></details>`,28)]))}const p=t(l,[["render",d]]),c=JSON.parse('{"path":"/docs/customerservice/msg.html","title":"客服消息","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1724238159000,"contributors":[{"name":"SessionHu","username":"SessionHu","email":"102411014+SessionHu@users.noreply.github.com","commits":1,"url":"https://github.com/SessionHu"}],"changelog":[{"hash":"60a0c5d1a2f44fe61335da04571305fa7727a968","time":1724238159000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"feat: 各种接口补充与错误修正 (#1066)"}]},"filePathRelative":"docs/customerservice/msg.md"}');export{p as comp,c as data};
