多協議接入 產品介紹 快速入門 用戶指南 開發指南
EDP TCP透傳 MQTT Modbus HTTP
常見問題

查詢訂閱topic的設備

請求方式:GET

URL: http://api.onenet.hk.chinamobile.com/mqtt/topic_device

URL參數

參數名稱 格式 是否必須 說明
topic string 發佈消息到指定的topic,只支援發佈qos=0的消息
page int 指定頁碼
per_page int 指定每頁輸出設備個數,預設30,最多1000

返回參數

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

data描述表

參數名稱 格式 說明
total_count int 查詢結果中設備的數量
page int 當前頁
per_page int 每頁設備數量
devices array-int 設備ID陣列

請求頭部示例

GET http://api.onenet.hk.chinamobile.com//mqtt/topic_device?topic=topic/test/01&page=1&per_page=100

返回示例

{
    "errno": 0,
    "data": {
        "per_page": 100,
        "devices": [39587277,39587272],
        "total_count": 2,
        "page": 1
    },
    "error": "succ"
}

个搜索结果,搜索内容 “

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