产品-用户自定义Topic
2025/10/12大约 4 分钟
产品-用户自定义Topic
新建用户自定义Topic
| POST | /admin-api/iot/user-product-topic/create |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productId | 产品ID,productId和productKey只需要传一个就可以 | json | - | long |
| productKey | 产品productKey,productId和productKey只需要传一个就可以 | json | - | string |
| topicShortName | topic子名称 | json | true | string |
| type | topic类型,1:发布;2:订阅;3:发布和订阅 | json | true | int32 |
| description | 描述 | json | false | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 创建成功返回产品属性Id | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": 1419193028974420,
"msg": ""
}获取产品自定义Topic
| GET | /admin-api/iot/user-product-topic/get |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | 产品自定义Topic Id | query | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 创建成功对象 | object |
| ---id | id | long |
| ---productId | productId | long |
| ---productKey | productKey | string |
| ---topicShortName | topic子名称 | string |
| ---type | topic类型,1:发布;2:订阅;3:发布和订阅 | int |
| ---description | 描述 | string |
| ---createTime | 创建时间,时间戳 | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"productId": 1414626985410560,
"productKey": "WSaSUV",
"topicShortName": "teaaeea",
"type": 1,
"description": "dadwa",
"id": 1419710456037376,
"createTime": 1733044990000
},
"msg": ""
}获取产品自定义Topic分页
| GET | /admin-api/iot/user-product-topic/page |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
| pageSize | 每页条数,最大值为 100,示例值(10) | query | true | int32 |
| productId | 产品Id | query | false | long |
| productKey | 产品productKey | query | false | string |
| topicShortName | 名称 | query | false | string |
| type | topic类型,1:发布;2:订阅;3:发布和订阅 | query | false | int32 |
| description | 描述,模糊搜索内容 | query | false | string |
| createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 成功分页数据 | object |
| ---total | 返回结果条数 | int |
| ---list | 返回数据列表 | array |
| ------id | id | long |
| ------productId | productId | long |
| ------productKey | productKey | string |
| ------topicShortName | topic子名称 | string |
| ------type | topic类型,1:发布;2:订阅;3:发布和订阅 | int |
| ------description | 描述 | string |
| ------createTime | 创建时间,时间戳 | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"topicShortName": "teaaeea",
"type": 1,
"description": "dadwa",
"id": 1419710456037376,
"createTime": 1733044990000
}
],
"total": 1
},
"msg": ""
}获取产品自定义Topic列表
| GET | /admin-api/iot/user-product-topic/list |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productId | 产品Id | query | false | long |
| productKey | 产品productKey | query | false | string |
| topicShortName | 名称 | query | false | string |
| type | topic类型,1:发布;2:订阅;3:发布和订阅 | query | false | int32 |
| description | 描述,模糊搜索内容 | query | false | string |
| createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 成功返回产品属性列表 | array |
| ---productId | productId | long |
| ---productKey | productKey | string |
| ---topicShortName | topic子名称 | string |
| ---type | topic类型,1:发布;2:订阅;3:发布和订阅 | int |
| ---description | 描述 | string |
| ---createTime | 创建时间,时间戳 | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": [
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"topicShortName": "teaaeea",
"type": 1,
"description": "dadwa",
"id": 1419710456037376,
"createTime": 1733044990000
}
],
"msg": ""
}删除产品自定义Topic
| DELETE | /admin-api/user-product-topic/delete |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | id | json | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 删除成功返回布尔状态 | boolean |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}