# 推送接口说明

# 物联网平台推送到第三方平台的接口

url:租户在物联网配置的推送服务url(采用post方式推送,如:http://example.com/push)

# 推送设备数据

请求参数:

名称 类型 描述
data_type int 数据类型:1.设备数据;2.设备状态;3.设备告警;(此处为1)
device_id string 设备标识
device_code string 设备编号
device_name string 设备名称
module_code string 模组编号
packet_code string 上行包编号
device_data object 设备数据(新版,建议使用)
event_time long 推送时间戳(毫秒)
data object 设备数据(旧版,可能在以后版本中删除,不建议使用)
device_attrs object 设备属性(旧版,可能在以后版本中删除,不建议使用)

请求示例:

{
  "data_type":1,
  "device_id":"23e2cd57b52761c6e8c1993538ab1913",
  "device_code":"testdev01",
  "device_name":"测试设备",
  "module_code":"testmdu01",
  "packet_code":"temperature",
  "device_data":[
    {
      "code":"temperature",
      "value":28.80,
      "unit":"℃",
      "name":"温度"
    },
    ...
  ],
  "data":	{
    "temperature":28.80,
    ...
  },
  "device_attrs":{
    "temperature":"温度",
    ...
  },
  "event_time":1597404895279
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# 推送设备状态数据

请求参数:

名称 类型 描述
data_type int 数据类型:1.设备数据;2.设备状态;3.设备告警;(此处为2)
device_id string 设备标识
device_code string 设备编号
device_name string 设备名称
device_status int 设备状态:1.在线;0.离线;
event_time long 推送时间戳(毫秒)

请求示例:

{
  "data_type":2,
  "device_id":"23e2cd57b52761c6e8c1993538ab1913",
  "device_code":"testdev01",
  "device_name":"测试设备",
  "device_status":1,
  "event_time":1597404895279
}
1
2
3
4
5
6
7
8

# 推送告警数据

请求参数:

名称 类型 描述
data_type int 数据类型:1.设备数据;2.设备状态;3.设备告警;(此处为3)
alarm_info Object 告警信息
user_account string 账号
user_nickName string 用户昵称
event_time long 推送时间戳(毫秒)

告警信息(alarm_info)结构

名称 类型 描述
alarmName string 告警名称
alarmLevel int 告警级别:1:紧急,2:重要,3:次要,4:提示
alarmDescribe string 告警描述
alarmTime string 告警时间
devId string 设备ID
devCode string 设备编号
devName string 设备名称

请求示例:

{
  "event_time": 1680579751534,
  "data_type": 3,
  "alarm_info": {
    //告警名称
    "alarmName": "",

    //告警级别:1:紧急,2:重要,3:次要,4:提示
    "alarmLevel": 0,

    //告警描述
    "alarmDescribe": "",

    //告警时间
    "alarmTime": "2023-04-04 11:10:17",

    //设备ID
    "devId": "",

    //设备编号
    "devCode": "",

    //设备名称
    "devName": "",

  },
  "user_account": "admin",
  "user_nickName": "管理员"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Last Updated: 4/4/2023, 11:44:35 AM