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

# Inquire Device Information in Batch

Request Method: GET

URL: http://iot.zong.com.pk:8000/devices

URL Parameter

Parameter Name Format Required Description
key_words string no match keyword, left matching from id and title fields
auth_info string no authentication information
tag array-string no device tag
online bool no device online status
private bool no device privacy
page int no specified page number, the maximum page number is 10000
per_page int no specify the number of output devices per page, default 30, up to 100
device_id string no specify device ID, separated by commas, up to 100
begin string no begining time, Beijing time, example: 2016-06-20
end string no end time, Beijing time, example: 2016-06-20

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 device related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
total_count int number of devices in query result
page int current page
per_page int number of devices per page
devices array-json json array of device information, see devices description table
devices Description Table
Parameter Name Format Description
protocol string device access protocol
create_time string device creation time, Beijing time
online bool device online status
id string device ID
auth_info string device authentication information, corresponding to "sn" or "mac" parameter in device registration interface
title string device name
desc string device description
tags array-string device tags
location json device location coordinate information, expressed in latitude and longitude key-value pairs: {"lon":xx,"lat":xx}
other json other custom information of device, expressed in key-value pair format, see example

Example 1 of Request

Inquire online device which tag is china and create_time is from 2017-02-04 to 2017-06-04

GET http://iot.zong.com.pk:8000/devices?begin=2017-02-04&end=2017-06-04&online=true&tag=china HTTP/1.1

Example 2 of Request

Inquire devices which device ID are 35282992, 35271941

GET http://iot.zong.com.pk:8000/devices?device_id=35282992,35271941 HTTP/1.1

Example 3 of Request

Inquire all devices under this product

GET http://iot.zong.com.pk:8000/devices HTTP/1.1

Example of Return

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

results matching ""

    No results matching ""