請求方式:GET
URL: http://api.onenet.hk.chinamobile.com/mqtt/topic_device
參數名稱 | 格式 | 是否必須 | 說明 |
---|---|---|---|
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"
}