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

View Trigger

A Single View

Request Method: GET

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

trigger_id: need to be replaced with device ID

http Header

Parameter Name Format Required Description
api-key string yes must be masterkey or apikey with access authority of the device
Content_Type string yes application/json

Return Parameter

Parameter Name Format Description
errno int code fie call error , 0 indicates call is successful
error string error description, "succ" indicates call is successful
data json trigger related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
id string trigger id
title string trigger name
url string url
type string trigger type
threshold int trigger value
invalid bool whether the trigger has lost efficacy
create_time string reation time of device trigger, Beijing time
Description
Trigger lose efficacy refers to the dataflow or device on which the trigger depends is deleted. Then the trigger will never trigger the event effectively.

Example of Request

GET http://iot.zong.com.pk:8000/triggers/350092 HTTP/1.1
api-key: WhI*************v1c=
Content-Type: application/json
Host: iot.zong.com.pk:8000

Example of Return

{
    "errno": 0,
    "data": {
        "id":350092,
        "title":"we du jian kong",
        "url":"xx.bb.com",
        "type":">=",
        "threshold":45
        "invalid":true,
        "create_time":"2018-04-24 10:22:22"
    },
    "error": "succ"
}

B Batch View

Request Method: GET

URL: http(s)://iot.zong.com.pk:8000/triggers

http Header

Parameter Name Format Required Description
api-key string yes must be masterkey or apikey with access authority of the device
Content_Type string yes application/json

url Parameter

Parameter Name Format Required Description
title string no specify the trigger name
page int no specify page number
per_page int No specify output number per page, default to 10, up to 100

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 trigger related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
total_count int total number of triggers
per_page int display number per page
page int page number
triggers array-json json array of triggers, see triggers description table
triggers Description Table
Parameter Name Format Description
id string trigger id
title string trigger name
url string url
type string trigger type
threshold int threshold value of trigger
invalid bool whether the trigger has lost efficacy
create_time string creation time of device trigger, Beijing time
Description

Trigger lose efficacy refers to the dataflow or device on which the trigger depends is deleted. Then the trigger will never trigger the event effectively.

Example of Request

GET http://iot.zong.com.pk:8000/triggers?page=1&per_page=30 HTTP/1.1
api-key: WhI*************v1c=
Content-Type: application/json
Host: iot.zong.com.pk:8000
Content-Length: 196

Example of Return

{
    "errno": 0,
    "data": {
        "total_count": 600,
        "per_page": 30,
        "page": 1,
        "triggers":[
            {
                "id":350092,
                "title":"we du jian kong",
                "url":"xx.bb.com",
                "type":">=",
                "threshold":45,
                "invalid":true,
                "create_time":"2018-04-24 10:22:22" 
            }
            {
                "id":350093,
                "title":"wen du jian kong",
                "url":"xx.bb.com",
                "type":">=",
                "threshold":45,
                "invalid":true,
                "create_time":"2018-04-24 10:22:22" 
            }
            ...
        ]
    },
    "error": "succ"
}

results matching ""

    No results matching ""