|
@@ -22,14 +22,15 @@
|
|
|
|
|
|
### 2.接口说明
|
|
### 2.接口说明
|
|
|
|
|
|
-|接口URL|请求类型|功能说明|
|
|
|
|
-|---|---|---
|
|
|
|
-|/application/v1/device/info|GET|根据device_key获取设备基本信息|
|
|
|
|
-|/application/v1//devices/{identifier}/info|GET|根据设备identifier获取设备信息|
|
|
|
|
-|/application/v1/devices/{identifier}/status/current|GET|获取设备当前状态|
|
|
|
|
-|/application/v1/devices/{identifier}/status|PUT|设置设备当前设备的状态|
|
|
|
|
-|/application/v1/devices/{identifier}/commands|POST|向指定设备发送命令|
|
|
|
|
-|/application/auth|POST|获取app认证token|
|
|
|
|
|
|
+| 接口URL | 请求类型 | 功能说明 |
|
|
|
|
+|-----------------------------------------------------|------|----------------------|
|
|
|
|
+| /application/v1/device/info | GET | 根据device_key获取设备基本信息 |
|
|
|
|
+| /application/v1//devices/{identifier}/info | GET | 根据设备identifier获取设备信息 |
|
|
|
|
+| /application/v1/devices/{identifier}/status/current | GET | 获取设备当前状态 |
|
|
|
|
+| /application/v1/devices/{identifier}/status | PUT | 设置设备当前设备的状态 |
|
|
|
|
+| /application/v1/devices/{identifier}/commands | POST | 向指定设备发送命令 |
|
|
|
|
+| /application/auth | POST | 获取app认证token |
|
|
|
|
+| /application/v1/device/check_net_config | GET | 验证设备配网结果 |
|
|
|
|
|
|
### 2.1 获取App Token
|
|
### 2.1 获取App Token
|
|
|
|
|
|
@@ -39,10 +40,10 @@ _首先应用方要获取当前应用的授权访问token,为后续的接口请
|
|
* 请求方法: `POST`
|
|
* 请求方法: `POST`
|
|
* 请求参数: `BODY`
|
|
* 请求参数: `BODY`
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|AppKey|字符串|Y|平台为应用分配的AppKey|
|
|
|
|
-Secretkey|字符串|Y|平台为应用分配的Secretkey
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|-----------|-----|------|-------------------|
|
|
|
|
+| AppKey | 字符串 | Y | 平台为应用分配的AppKey |
|
|
|
|
+| Secretkey | 字符串 | Y | 平台为应用分配的Secretkey |
|
|
|
|
|
|
* 接口响应: `JSON`
|
|
* 接口响应: `JSON`
|
|
|
|
|
|
@@ -57,10 +58,10 @@ Secretkey|字符串|Y|平台为应用分配的Secretkey
|
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
-|字符|类型|说明|
|
|
|
|
-|---|---|---|
|
|
|
|
-|access_token|字符串|token字符串
|
|
|
|
-expire_at|数字|精确到秒的过期时间戳
|
|
|
|
|
|
+| 字符 | 类型 | 说明 |
|
|
|
|
+|--------------|-----|------------|
|
|
|
|
+| access_token | 字符串 | token字符串 |
|
|
|
|
+| expire_at | 数字 | 精确到秒的过期时间戳 |
|
|
|
|
|
|
### 2.2 根据设备device_key获取设备信息
|
|
### 2.2 根据设备device_key获取设备信息
|
|
|
|
|
|
@@ -70,15 +71,15 @@ _厂商可以通过平台为设备生成的device_key查询设备基础信息_
|
|
* 请求方法: `GET`
|
|
* 请求方法: `GET`
|
|
* 请求参数: `Query`
|
|
* 请求参数: `Query`
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|device_key|字符串|Y|设备device_key,注册流程可以得到这个数据|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|------------|-----|------|---------------------------|
|
|
|
|
+| device_key | 字符串 | Y | 设备device_key,注册流程可以得到这个数据 |
|
|
|
|
|
|
* 请求Header:
|
|
* 请求Header:
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|Authorization|字符串|Y|获取AppToken(2.1)接口返回的access_token字段值|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|---------------|-----|------|-------------------------------------|
|
|
|
|
+| Authorization | 字符串 | Y | 获取AppToken(2.1)接口返回的access_token字段值 |
|
|
|
|
|
|
* 请求响应:
|
|
* 请求响应:
|
|
|
|
|
|
@@ -102,16 +103,16 @@ _厂商可以通过平台为设备生成的device_key查询设备基础信息_
|
|
* 请求方法: `GET`
|
|
* 请求方法: `GET`
|
|
* 请求参数: `Path参数`
|
|
* 请求参数: `Path参数`
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|identifier|字符串|Y|设备的identifier,注册流程可以得到这个数据|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|------------|-----|------|----------------------------|
|
|
|
|
+| identifier | 字符串 | Y | 设备的identifier,注册流程可以得到这个数据 |
|
|
|
|
|
|
* 请求Header:
|
|
* 请求Header:
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|App-Key|字符串|Y|由平台分配的应用AppKey的值|
|
|
|
|
-|Authorization|字符串|Y|获取AppToken(2.1)接口返回的access_token字段值|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|---------------|-----|------|-------------------------------------|
|
|
|
|
+| App-Key | 字符串 | Y | 由平台分配的应用AppKey的值 |
|
|
|
|
+| Authorization | 字符串 | Y | 获取AppToken(2.1)接口返回的access_token字段值 |
|
|
|
|
|
|
* 请求响应: `JSON`
|
|
* 请求响应: `JSON`
|
|
|
|
|
|
@@ -135,16 +136,16 @@ _厂商可以通过平台为设备生成的device_key查询设备基础信息_
|
|
* 请求方法: `GET`
|
|
* 请求方法: `GET`
|
|
* 请求参数: `Path参数`
|
|
* 请求参数: `Path参数`
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|identifier|字符串|Y|设备的identifier,注册流程可以得到这个数据|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|------------|-----|------|----------------------------|
|
|
|
|
+| identifier | 字符串 | Y | 设备的identifier,注册流程可以得到这个数据 |
|
|
|
|
|
|
* 请求Header:
|
|
* 请求Header:
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|App-Key|字符串|Y|由平台分配的应用AppKey的值|
|
|
|
|
-|Authorization|字符串|Y|获取AppToken(2.1)接口返回的access_token字段值|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|---------------|-----|------|-------------------------------------|
|
|
|
|
+| App-Key | 字符串 | Y | 由平台分配的应用AppKey的值 |
|
|
|
|
+| Authorization | 字符串 | Y | 获取AppToken(2.1)接口返回的access_token字段值 |
|
|
|
|
|
|
* 请求响应: `JSON`
|
|
* 请求响应: `JSON`
|
|
|
|
|
|
@@ -171,9 +172,9 @@ _data字符中的具体响应内容是根据产品配置中相应的字段名称
|
|
* 请求方法: `POST`
|
|
* 请求方法: `POST`
|
|
* 请求参数: `JSON BODY`
|
|
* 请求参数: `JSON BODY`
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|identifier|字符串|Y|设备的identifier,注册流程可以得到这个数据|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|------------|-----|------|----------------------------|
|
|
|
|
+| identifier | 字符串 | Y | 设备的identifier,注册流程可以得到这个数据 |
|
|
|
|
|
|
* BODY体结构: `根据产品的配置文件`
|
|
* BODY体结构: `根据产品的配置文件`
|
|
|
|
|
|
@@ -274,10 +275,10 @@ _例如上面的产品配置信息,commands字段有一个指令名称为setSt
|
|
|
|
|
|
* 请求Header:
|
|
* 请求Header:
|
|
|
|
|
|
-|参数|类型|是否必填|说明|
|
|
|
|
-|---|----|-----|----|
|
|
|
|
-|App-Key|字符串|Y|由平台分配的应用AppKey的值|
|
|
|
|
-|Authorization|字符串|Y|获取AppToken(2.1)接口返回的access_token字段值|
|
|
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|---------------|-----|------|-------------------------------------|
|
|
|
|
+| App-Key | 字符串 | Y | 由平台分配的应用AppKey的值 |
|
|
|
|
+| Authorization | 字符串 | Y | 获取AppToken(2.1)接口返回的access_token字段值 |
|
|
|
|
|
|
* 请求响应: `JSON`
|
|
* 请求响应: `JSON`
|
|
|
|
|
|
@@ -287,4 +288,27 @@ _例如上面的产品配置信息,commands字段有一个指令名称为setSt
|
|
"message": "",
|
|
"message": "",
|
|
"result": null
|
|
"result": null
|
|
}
|
|
}
|
|
-```
|
|
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+### 2.6 验证设备配网结果
|
|
|
|
+
|
|
|
|
+* 请求URL: `/application/v1/devices/check_net_config`
|
|
|
|
+* 请求方法: `GET`
|
|
|
|
+* 请求参数: `Query`
|
|
|
|
+
|
|
|
|
+| 参数 | 类型 | 是否必填 | 说明 |
|
|
|
|
+|-------------|-----|------|---------------|
|
|
|
|
+| device_code | 字符串 | Y | 设备的identifier |
|
|
|
|
+| md5 | 字符串 | Y | 校验hash |
|
|
|
|
+
|
|
|
|
+* 响应BODY: `JSON`
|
|
|
|
+
|
|
|
|
+```json
|
|
|
|
+{
|
|
|
|
+ "code": 0,
|
|
|
|
+ "message": "",
|
|
|
|
+ "result": false
|
|
|
|
+ // false或true,代表失败或成功
|
|
|
|
+}
|
|
|
|
+```
|
|
|
|
+
|