创建设备模板
本地
本地
POST
http://127.0.0.1:9999/api/v1/device_config
设备配置
请求参数
Header 参数
x-token
string
可选
默认值:
{{x-token}}
Body 参数application/json
additional_info
string
附加信息
description
string
描述
<= 255 字符
device_template_id
string
设备模板id
<= 36 字符
device_type
string
设备类型
<= 9 字符
name
string
设备配置名称
<= 99 字符
protocol_config
string
可选
protocol_type
string
可选
<= 36 字符
remark
string
备注
<= 255 字符
voucher_type
string
可选
<= 36 字符
示例
{
"device_type": "1",
"name": "xxxx",
"protocol_type": "MQTT",
"voucher_type": "xxxx",
"description": "xxxxxxxxxxxxxxxxxx",
"protocol_config": "{\"aa\":1}"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://127.0.0.1:9999/api/v1/device_config' \
--header 'x-token: {{x-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"device_type": "1",
"name": "xxxx",
"protocol_type": "MQTT",
"voucher_type": "xxxx",
"description": "xxxxxxxxxxxxxxxxxx",
"protocol_config": "{\"aa\":1}"
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
示例
{
"code": 200,
"message": "Create deviceconfig successfully"
}
修改于 2025-03-24 08:03:14