Device Management API-V1

gateway list

GET {host}/1.0/lists/gateway

get the list of gateways

Query Parameters

Name
Type
Description

offset

number

current page number, start from 1, default = 1

length

string

the number of rows in page, default = 20

{
    "code": "0",
    "data": {
        "page": {
            "count": "8"
        },
        "list": [
            {
                "dev_eui": "2CF7F11113500001",
                "dev_name": "2CF7F11113500001_gateway",
                "org_id": "1411841915123",
                "position_source": "1",
                "dev_country": "",
                "frequency": "920",
                "device_network": "1",
                "position": {
                    "lon": "113.926979",
                    "lat": "22.573724"
                },
                "description": "",
                "reg_time": "1567041885000",
                "bind_time": "1571208951000",
                "latestmsg_time": "0",
                "online_status": "0"
            }
        ]
    }
}

Example request

curl --request GET \
     --url {host}/1.0/lists/gateway?offset=1&length=2 \
     --user '<username>:<password>'

get gateway detail

GET {host}/1.0/gateway/:gateway_eui

get the detail of a specific gateway

Path Parameters

Name
Type
Description

gateway_eui

string

device EUI

{
    "code": "0",
    "data": { 
        "frequency": "470",  // frequency
        "dev_eui": "2CF7F11213200000", // gateway EUI, equipment unique identity
        "dev_name": "2CF7F11014300001", // gateway name
        "dev_country": "China",  // name country, defined by customer
        "device_network": "1",
        "description": "a gateway for test", // desc something
        "position": {                        // geographic
            "lon": "113.926979",
            "lat": "22.573724"
        },
        "position_source": "0",
        "reg_time": "1565313100000", // when the customer activates the device, unit milliseconds
        "bind_time": "0",   // the gateway bind time, unit milliseconds
        "dev_area": "Asia", // gateway area, Europe America Asia
        "latestmsg_time": "0",  // the latest message time, unit milliseconds
        "online_status": "0"    // 1 online, 0 offline
    }
}

Example request

curl --request GET \
     --url {host}/1.0/gateway/:gateway_eui \
     --user '<username>:<password>'

node list

GET {host}/1.0/lists/node

get the list of Node devices

Query Parameters

Name
Type
Description

length

string

the number of rows in page, default = 20

offset

string

current page number, start from 1, default = 1

{
    "code": "0",
    "data": {
        "page": {
            "count": "84"  // total number 
        }, 
        "list": [
            {
                "dev_eui": "2CF7F1201350001A", // node EUI, equipment unique identity
                "dev_name": "2CF7F1201350001A", // node name
                "org_id": "1411841915123",
                "position_source": "0",
                "dev_country": "American Samoa", // name country, defined by customer
                "frequency": "868",    // frequency
                "device_network": "1",
                "description": "21111", // desc something
                "reg_time": "1567041874000",
                "bind_time": "1571209669000",
                "group_unique_name": "00452831720DCA8A",
                "position": {
                    "lat": "26.15868",
                    "lon": "111.304984"
                },
                "latestmsg_time": "0", // the latest message time, unit milliseconds
                "online_status": "0", // 1 online, 0 offline
                "battery_status": "1", // 1 node battery for good, 0 node battery for bad
                "group_name": "22"
            }
        ]
    }
}

Example request

curl --request GET \
     --url {host}/1.0/lists/node?offset=1&length=2 \
     --user '<username>:<password>'

get node detail

GET {host}/1.0/node/:node_eui

get the detail of a specific node

Path Parameters

Name
Type
Description

node_eui

string

device EUI

{
    "code": "0",
    "data": {
        "frequency": "AS470-510",
        "dev_eui": "2CF7F16221200060",
        "dev_name": "2CF7F12010700002",
        "dev_country": "",
        "description": "",
        "reg_time": "1584528155000",
        "dev_area": "Asia",
        "latestmsg_time": "1587366392944",
        "online_status": "0",
        "battery_status": "1",
        "group_name": "",
        "activate_time": "0",
        "sensors": [
            {
                "sensor_eui": "0111006221200060",
                "sensor_channel": "11",
                "sensor_type": "2001",
                "sensor_measure": [
                    {
                        "id": "4097"
                    }
                ]
            }
        ]
    }
}

Example request

curl --request GET \
     --url {host}/1.0/node/:node_eui \
     --user '<username>:<password>'

sensor measure list

GET {host}/1.0/lists/sensor/measure

get the list of all physical measurements of all sensor types. also see Appendix - List of Sensor Types.

{
    "code": "0",
    "data": [
        {
            "sensor_id": "1009",
            "sensor_name": "Wind Speed",
            "sensor_measure": [
                {
                    "measure_id": "4112",
                    "measure_name": "Wind Direction",
                    "measure_unit": "°"
                },
                {
                    "measure_id": "4105",
                    "measure_name": "Wind Speed",
                    "measure_unit": "m/s"
                }
            ]
        },
        {
            "sensor_id": "1008",
            "sensor_name": "Wind Direction",
            "sensor_measure": [
                {
                    "measure_id": "4104",
                    "measure_name": "Wind Direction",
                    "measure_unit": "°"
                }
            ]
        },
        {
            "sensor_id": "1006",
            "sensor_name": "Soil temperature and humidity",
            "sensor_measure": [
                {
                    "measure_id": "4103",
                    "measure_name": "Soil Humidity",
                    "measure_unit": "%RH"
                },
                {
                    "measure_id": "4102",
                    "measure_name": "Soil Temperature",
                    "measure_unit": "°C"
                }
            ]
        },
        {
            "sensor_id": "1005",
            "sensor_name": "Atmospheric Pressure",
            "sensor_measure": [
                {
                    "measure_id": "4101",
                    "measure_name": "Atmospheric Pressure",
                    "measure_unit": "Pa"
                }
            ]
        },
        {
            "sensor_id": "1004",
            "sensor_name": "Carbon Dioxide",
            "sensor_measure": [
                {
                    "measure_id": "4100",
                    "measure_name": "Carbon Dioxide",
                    "measure_unit": "Vol"
                }
            ]
        },
        {
            "sensor_id": "1003",
            "sensor_name": "Light Intensity",
            "sensor_measure": [
                {
                    "measure_id": "4099",
                    "measure_name": "Light Intensity",
                    "measure_unit": "Lux"
                }
            ]
        },
        {
            "sensor_id": "1001",
            "sensor_name": "Air Temperature and Humidity",
            "sensor_measure": [
                {
                    "measure_id": "4098",
                    "measure_name": "Air Humidity",
                    "measure_unit": "%RH"
                },
                {
                    "measure_id": "4097",
                    "measure_name": "Air Temperature",
                    "measure_unit": "℃"
                }
            ]
        }
    ],
    "time": 1.958
}

Example request

curl --request GET \
     --url {host}/1.0/lists/sensor/measure \
     --user '<username>:<password>' \

check device eui and code

POST {host}/1.0/device/check_eui

Request Body

Name
Type
Description

code

string

device code

eui

string

device eui

{
    "code": "0",
    "data": {
        "check": "1"  // 0-check fail,1-check success
    },
    "time": 0.261
}

Example request

curl --request POST \
     --url '{host}/1.0/device/check_eui' \
     --user '<username>:<password>' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data '{"code":"device code","eui":"device eui"}' \
     --include

bind device

POST {host} /1.0/device/bind

bind device to account

Request Body

Name
Type
Description

eui

string

device eui

code

string

device code

device_name

string

device name

group_uinque_name

string

group unique name,available through the group list interface

lon

string

device positon, longitude

lat

string

device postion,latitude

{
    "code": "0",
    "data": {},
    "time": 0.261
}

Example request

curl --request POST \
     --url '{host}/1.0/device/check_eui' \
     --user '<username>:<password>' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data '{"code":"device code","eui":"device eui"}' \
     --include

Last updated