【29】上传图片_千牛
<p>[TOC]</p>
<h5>接口状态</h5>
<ul>
<li><code>正常</code></li>
</ul>
<h5>框架版本</h5>
<ul>
<li><code>≥ 2.0.5.0</code></li>
</ul>
<h5>更新时间</h5>
<ul>
<li><code>2024/11/23</code></li>
</ul>
<h5>调用额度</h5>
<ul>
<li><code>免额度</code></li>
</ul>
<h5>简要描述</h5>
<ul>
<li>上传图片·千牛</li>
</ul>
<h5>DLL调用例子</h5>
<pre><code>Api_GetImageUrl_qianniu(&quot;$userNick$&quot;,&quot;C:\Users\Administrator\Desktop\111.png&quot;)</code></pre>
<h5>易语言模块调用例子</h5>
<pre><code>SaiNiu.Api.上传图片_千牛(&quot;$userNick$&quot;,&quot;C:\Users\Administrator\Desktop\111.png&quot;)</code></pre>
<h5>POST调用例子</h5>
<pre><code>http://127.0.0.1:3030/SaiNiuApi/Api</code></pre>
<pre><code>&amp;post=GetImageUrl_qianniu&amp;data={&quot;userNick&quot;:&quot;$userNick$&quot;,&quot;imagePath&quot;:&quot;C:\\Users\\Administrator\\Desktop\\111.png&quot;}</code></pre>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th style="text-align: left;">是否必填</th>
<th style="text-align: left;">说明</th>
<th>示例</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">userNick</td>
<td style="text-align: left;">文本型</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">千牛账号,为方便测试$userNick$表示取随机队列账号</td>
<td>tb123456</td>
</tr>
<tr>
<td style="text-align: left;">imagePath</td>
<td style="text-align: left;">文本型</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">图片本地路径</td>
<td>C:\Users\Administrator\Desktop\111.png</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<pre><code>{&quot;object&quot;:{&quot;fileId&quot;:&quot;1823808298689641822&quot;,&quot;folderId&quot;:&quot;0&quot;,&quot;url&quot;:&quot;https://img.alicdn.com/imgextra/i3/796978238/O1CN01YhyODy2Aj3nr8hbZ8_!!796978238.png&quot;,&quot;fileName&quot;:&quot;111.png&quot;,&quot;size&quot;:&quot;4548&quot;,&quot;pix&quot;:&quot;315x251&quot;},&quot;total&quot;:0,&quot;hasNext&quot;:true,&quot;success&quot;:true,&quot;status&quot;:0,&quot;message&quot;:&quot;&quot;}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">fileId</td>
<td style="text-align: left;">文本型</td>
<td>图片id</td>
</tr>
<tr>
<td style="text-align: left;">url</td>
<td style="text-align: left;">文本型</td>
<td>图片网络链接</td>
</tr>
<tr>
<td style="text-align: left;">fileName</td>
<td style="text-align: left;">文本型</td>
<td>图片名称</td>
</tr>
<tr>
<td style="text-align: left;">size</td>
<td style="text-align: left;">文本型</td>
<td>大小</td>
</tr>
<tr>
<td style="text-align: left;">pix</td>
<td style="text-align: left;">文本型</td>
<td>宽*高</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>