OneNET IoT Platform Platform Introduction Introduction Manual Guidline for Device Development Guideline for Application Development
API
API Usage API List SDK MQTT LwM2M EDP Modbus TCP
HTTP Push

# Add Trigger Request Method: POST

URL: http://iot.zong.com.pk:8000/triggers

http body Parameter

Parameter Name Format Required Description
title string yes trigger name
ds_id string yes datastream name
dev_ids array-string no device ID, default to all devices by default
url string yes alarm notification address
type string yes trigger condition, see type description list
threshold yes trigger condition threshold, used coordinating with type, see type description list
type Description List
type description
> threshold must be numberic value
< threshold must be numberic value
>= threshold must be numberic value
<= threshold must be numberic value
inout threshold is set to {"lolmt":40, "uplmt":52}, indicates that to trigger when the data value is entering or leaving the closed interval [40, 52]
in threshold is set to {"lolmt":40, "uplmt":52}, indicates that to trigger when the data value is entering the closed interval [40, 52]
out threshold is set to {"lolmt":40, "uplmt":52}, indicates that to trigger when the data value is leaving the closed interval [40, 52]
change threshold parameter does no need to be passed; triggers alarm when the uploaded value changes
frozen threshold is numberic value that specifies triggering an alarm after how many seconds to report data, and the monitored object enters the frozen state.
live threshold is numberic value, specify after how many seconds to update data to trigger an alarm.

Return Parameter

Parameter Name Format Description
errno int code for call error, 0 indicates call is successful
error string error description, "succ" indicates call is successful
data json device related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
trigger_id int trigger ID
POST http://iot.zong.com.pk:8000/triggers HTTP/1.1

Example of Request Parameter

{
    "title": "trigger",
    "ds_id": "gps",
    "url": "http://aoic.choqf.com",
    "type": ">",
    "threshold": 100
}
{
    "errno":0,
    "data": {
        "trigger_id":123809
    },
    "error":"succ"
}

Example of Trigger Data

{
    "trigger": {
        "id": 123809,
        "threshold": 9.0,
        "type": ">"
    },
    "current_data": [{
            "dev_id": "2656",
            "ds_id": "gps",
            "ds_uuid": "FWEF-ZFW-ZFW-ZFWW",
            "at": "2009-09-07T12:16:02.001403Z",
            "value": 100
        }
    ]
}

results matching ""

    No results matching ""