添加触发器
| 功能说明 | 添加触发器 | | ------------ | ------------ | | URL 地址 | https://cloudapi.usr.cn/usrCloud/trigger/addTrigger | | HTTPS 请求方式 | POST | 请求参数 |参数名|必选|类型|说明| | ------------ | ------------ | ------------ | ------------ | |triggerName |true |String |触发器名称| |dataPointId |true |Integer |数据点ID| |triggerCondition |true |String |触发条件(0:开关ON、1:开关OFF、2:数值低于、3:数值高于、4:数值介于、5:数值高于max低于min)| |insertType |true |Integer |数据存储方式(0:存储阈值、1:不存储、2:存储所有报警)| |alarmModes |true |List |存放报警模式(0:短信报警、1:微信报警、2:邮件报警)的集合| |templateId |true |Integer |模板ID| |max |true |Integer |最大值| |min |true |Integer |最小值| |min |true |Integer |最小值| |contacts |true |List |存放报警联系人或报警组的数组| |token |true |String |登录成功时返回的 token| 请求示例 ```JSON { "triggerName": "xx触发器", "dataPointId": 528, "triggerCondition": "0", "insertType": 0, "alarmModes": [ 1, 2 ], "templateId": 64, "max": 66, "min": 64, "contacts": [ { "contactId": 456789, "contactType": 0 //标识0为报警联系人 }, { "contactId": 123, "contactType": 1 //标识1为报警组 } ], "token": "eyJ.eyJzdWIijYwfQ.dhkrCCyMEe..." } ``` 返回示例(成功): ```JSON { "data": "", "info": "ok", "status": 0 } ``` **返回码(status)说明** |返回码|说明| |:--|:--| |0|成功| **备注** - 更多返回错误代码请看首页的错误代码描述