API 参考
平台提供 RESTful API,便于第三方系统集成。
鉴权
所有请求需在 Header 中携带 Authorization: Bearer <token>,token 通过 AccessKey 换取。
设备列表
GET /api/v1/devices?productId={productId}返回指定产品下的设备列表。
下发指令
POST /api/v1/devices/{deviceId}/commands
Content-Type: application/json
{ "method": "setSwitch", "params": { "on": true } }返回码
| Code | 含义 |
|---|---|
| 0 | 成功 |
| 401 | 鉴权失败 |
| 404 | 资源不存在 |
| 500 | 服务器错误 |
