NB-IoT Suite Product Introduction QuickStart User Guide Device Development Guide Application Development Guide Best Practices FAQ Service agreement Update Log

Batch query of device information

Request format: GET

URL: http(s)://api.heclouds.com/devices

I only want to see examples!!!

Url parameter

Parameter NameFormatRequired?Description
key_wordsstringNoMatch the key word from the left of id and title field.
auth_infostringNoAuthentication information
tagarray-stringNoDevice tag
onlineboolNoDevice online status
privateboolNoDevice privacy
pageintNoSpecify the page number, max. 10000
per_pageintNoSpecify the number of output devices on each page, by default 30, maximum 100
device_idstringNoSpecify the device ID, separated by commas, max. 100
beginstringNoBeginning time, Beijing time. Example: 10/1/2019
endstringNoEnd time, Beijing time. Example:10/1/2019

Return Parameters

NameFormatDescription
errnointCall error code, where 0 means success.
error stringError description, where "succ" means success.
datajsonDevice dependent message returned after the interface is successfully invoked; see Data Description Table

Data Description Table

NameFormatDescription
total_countintNumber of devices in the query result
pageintCurrent page number
per_pageintNumber of devices per page
devicesarray-jsonJson data array of the device information; see devices description list.

Device Description Table

NameFormatDescription
protocolstringDevice access protocol
create_timestringDevice creation time, Beijing time
onlineboolDevice online status
idstringDevice ID
auth_infostringDevice authorization information, corresponding to “sn” or “mac” parameter in the device registration interface
titlestringDevice name
descstringDevice description
tagsarray-stringDevice tag
locationjsonDevice location coordinate, represented by latitude and longitude key-value {“lon” xx “lat” xx}
otherjsonOther custom information of the device, in the key-value pair format. See the example.

Request Example 1

Query the online device created from 2017-02-04 to 2017-06-04 with the tag being china.

GET http://api.heclouds.com/devices?begin=2017-02-04&end=2017-06-04&online=true&tag=china HTTP/1.1

Request Example 2

Query two devices with the device ID being 35282992 and 35271941.

GET http://api.heclouds.com/devices?device_id=35282992,35271941 HTTP/1.1

Request Example 3

Query all devices under this product

GET http://api.heclouds.com/devices HTTP/1.1

Return Example

{
    "errno": 0,
    "data": {
        "per_page": 30,
        "devices": [{
            "protocol": "EDP",
            "other": {
                "version": "1.0.0",
                "manufacturer": "china mobile"
            },
            "create_time": "2018-06-04 17:43:11",
            "online": true,
            "location": {
                "lat": 23.54,
                "lon": 109
            },
            "id": "35282992",
            "auth_info": "tes01235n82105",
            "title": "test_device",
            "desc": "test_desc",
            "tags": ["china", "mobile"]
        }, {
            "protocol": "EDP",
            "create_time": "2018-06-04 11:15:38",
            "online": true,
            "id": "35271941",
            "auth_info": "tes810372105",
            "title": "test_device",
            "tags": ["china"]
        }],
        "total_count": 2,
        "page": 1
    },
    "error": "succ"
}

< query device details

query device condition in batch>

个搜索结果,搜索内容 “

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