[NB-IoT物聯網套件] 產品介紹 快速入門 用戶指南 設備開發指南 應用開發指南 最佳實踐 常見問題 服務協議 變更日誌

查看觸發器

跳轉到批量查看

1. 單個查看

請求方式:GET

URL: http(s)://api.onenet.hk.chinamobile.com/triggers/{trigger_id}

說明:trigger_id需要替換為設備ID。

返回參數

參數名稱格式說明
errnoint調用錯誤碼,為0表示調用成功
error string錯誤描述,為"succ"表示調用成功
datajson介面調用成功之後返回的設備相關信息,見data描述表

data描述表

參數名稱格式說明
idstring觸發器id
titlestring觸發器名稱
urlstringurl
typestring觸發器類型
thresholdint觸發器值
invalidbool觸發器是否已失效
create_timestring設備觸發器時間,北京時間
說明

触发器失效是指触发器所依赖的数据流或者设备被删除了。此时触发器永远不会有效触发事件。

請求示例

GET http://api.onenet.hk.chinamobile.com/triggers/350092 HTTP/1.1
api-key: WhI*************v1c=
Content-Type: application/json

返回示例

{
    "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"
}

2.批量查看

請求方式:GET

URL: http(s)://api.onenet.hk.chinamobile.com/triggers

http頭部

參數名稱格式是否必須說明
api-keystring必須為masterkey或者具備該設備存取權限的ap key
Content_Typestringapplication/json

url參數

參數名稱格式是否必須說明
titlestring指定觸發器名稱
pageint指定頁碼
per_pageint指定每頁輸出個數,默認為10 個,最多100個

返回參數

參數名稱格式說明
errnoint調用錯誤碼,為0表示調用成功
error string錯誤描述,為"succ"表示調用成功
datajson介面調用成功之後返回的設備相關信息,見data描述表

data描述表

參數名稱格式說明
total_countint觸發器總數
per_pageint每頁顯示個數
pageint頁碼
triggersarray-json觸發器的json陣列,見triggers描述表

triggers描述表

參數名稱格式說明
idstring觸發器id
titlestring觸發器名稱
urlstringurl
typestring觸發器類型
thresholdint觸發器值
invalidbool觸發器是否已失效
create_timestring設備觸發器時間,北京時間

說明

觸發器失效是指觸發器所依賴的數據流或者設備被刪除了,此時觸發器永遠不會有效觸發事件。

請求示例

GET http://api.onenet.hk.chinamobile.com/triggers?page=1&per_page=30 HTTP/1.1
api-key: WhI*************v1c=
Content-Type: application/json

返回示例

{
    "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"
}

< 更新觸發器

刪除觸發器 >

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “