创建产品
本地
本地
POST
http://127.0.0.1:9999/api/v1/product
产品管理
请求参数
Header 参数
x-token
string
可选
默认值:
{{x-token}}
Body 参数application/json
additional_info
string
附加信息
description
string
产品描述
<= 255 字符
image_url
string
产品图片
<= 500 字符
name
string
产品名称
<= 255 字符
product_key
string
可选
<= 255 字符
product_model
string
产品型号
<= 100 字符
product_type
string
产品类型
<= 36 字符
remark
string
备注
<= 255 字符
device_config_id
string
设备配置id
示例
{
"name": "xxxxxxxx",
"description": "xxxxxxxxxxxxx",
"product_type": "xxxxxx",
"image_url": "http://dummyimage.com/400x400",
"additional_info": "{}",
"remark": "in irure fugiat",
"product_model": "xxxxxxxx",
"product_key": "",
"device_config_id": "a54d83e7-2858-8331-3783-f936c4198a66"
}
示例代码
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/product' \
--header 'x-token: {{x-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "xxxxxxxx",
"description": "xxxxxxxxxxxxx",
"product_type": "xxxxxx",
"image_url": "http://dummyimage.com/400x400",
"additional_info": "{}",
"remark": "in irure fugiat",
"product_model": "xxxxxxxx",
"product_key": "",
"device_config_id":"a54d83e7-2858-8331-3783-f936c4198a66"
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
id
string
必需
name
string
必需
description
string
必需
product_type
string
必需
product_key
string
必需
product_model
string
必需
image_url
string
必需
created_at
string
必需
remark
string
必需
additional_info
string
必需
tenant_id
string
必需
device_config_id
string
必需
示例
{
"code": 200,
"message": "Create product successfully",
"data": {
"id": "bfc5806a-e5f2-2f5e-d081-19c3d84f389e",
"name": "xxxxxxxx",
"description": "xxxxxxxxxxxxx",
"product_type": "xxxxxx",
"product_key": "bfc5806a",
"product_model": "xxxxxxxx",
"image_url": "http://dummyimage.com/400x400",
"created_at": "2024-03-05T15:10:37.1315434+08:00",
"remark": "in irure fugiat",
"additional_info": "{}",
"tenant_id": "2f4306df",
"device_config_id": "a54d83e7-2858-8331-3783-f936c4198a66"
}
}
修改于 2024-05-11 10:31:37