2、添加设备
<h4>请求地址</h4>
<ul>
<li>正式环境: <a href="https://www.lampmind.com/api/mpTool/save_device">https://www.lampmind.com/api/mpTool/save_device</a></li>
<li>测试环境: <a href="https://sd.solar-iot.com/api/mpTool/save_device">https://sd.solar-iot.com/api/mpTool/save_device</a></li>
</ul>
<h4>请求方法</h4>
<p><strong>POST</strong></p>
<h4>请求参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>说明</th>
<th>是否必须</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>用户名</td>
<td>Y</td>
</tr>
<tr>
<td>client_key</td>
<td>string</td>
<td>设备唯一码(imei)</td>
<td>Y</td>
</tr>
<tr>
<td>token</td>
<td>string</td>
<td>鉴权口令</td>
<td>Y</td>
</tr>
<tr>
<td>os</td>
<td>string</td>
<td>使用平台(0:PC, 1:iOS, 2:Android</td>
<td>Y</td>
</tr>
<tr>
<td>sn</td>
<td>number</td>
<td>设备地址</td>
<td>Y</td>
</tr>
<tr>
<td>protocoltype</td>
<td>string</td>
<td>网络协议类型(0 = lorawan, 1 = lora mesh, 2 = rf mesh, 3 = nbiot, 4 = gprs_direct, 5 = zigbee,6 = WeloraWan, 7 = onenet, 8 = mqtt, 10 = 4G)</td>
<td>Y</td>
</tr>
<tr>
<td>control_type</td>
<td>string</td>
<td>控制器类型(0:WE-MA-10,1:WE-MA-20,2:WE-CON-10,3:WE-CON-20,4:WE-CON-P10,5:WE-CON-4G20,6:WE-CON-4G10,7:WE-CON-4G11,8:WE-CON-P20,9 WE-CON-N20(nb 双控),10 WE-CON-N10(nb 单控))</td>
<td>Y</td>
</tr>
</tbody>
</table>
<h4>返回参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>说明</th>
<th>必须存在</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>string</td>
<td>返回码</td>
<td>Y</td>
</tr>
<tr>
<td>msg</td>
<td>string</td>
<td>返回信息</td>
<td>Y</td>
</tr>
<tr>
<td>data</td>
<td>object</td>
<td>结果数据</td>
<td>Y</td>
</tr>
</tbody>
</table>
<h4>返回内容实例</h4>
<pre><code>{
"code": "00000",
"msg": "操作成功",
"data": {
"list": [
{
"id": "56",
"dev_online ":0
}
],
"total ": 1
}
}</code></pre>