gateway list

GET
{host}/device/list_gateways
get the list of gateways
Query Parameters
offset
number
current page number, start from 1, default = 1
length
string
the number of rows in page, default = 20

response

{
    "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}/device/list_gateways?offset=1&length=2 \
     --user '<username>:<password>'

node list

GET
{host}/device/list_nodes
get the list of Node devices
Query Parameters
offset
number
current page number, start from 1, default = 1
length
string
the number of rows in page, default = 20

response

{
    "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}/device/list_nodes?offset=1&length=2 \
     --user '<username>:<password>'

get gateway detail

GET
{host}/device/view_gateway/:eui
get the detail of a specific gateway
Path Parameters
gateway_eui
(required)
string
device EUI

response

{
    "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}/device/view_gateway/:eui \
     --user '<username>:<password>'

get node detail

GET
{host}/device/view_gateway/:eui
get the detail of a specific node
Path Parameters
node_eui
(required)
string
device EUI

response

{
    "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}/device/view_gateway/:eui \
     --user '<username>:<password>'

sensor measure list

GET
{host}/sensor/measurements
get the list of all physical measurements of all sensor types. also see Appendix - List of Sensor Types.

response

{
    "code": "0",
    "data": [
        {
            "sensor_id": "1001",
            "sensor_name": "SenseCAP AirTemp&Humi Sensor",
            "sensor_measure": [
                {
                    "measure_id": "4097",
                    "measure_name": "Air Temperature",
                    "measure_unit": "℃"
                },
                {
                    "measure_id": "4098",
                    "measure_name": "Air Humidity",
                    "measure_unit": "%RH"
                }
            ]
        },
        ...
    ]
}

Example request

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

Sensor measure list V2

GET
{host}/list_measurement_reference
get the list of all physical measurements of all sensor types. also see Appendix - List of Sensor Types.

Response

Name Description
sensor_type Sensor type
sensor_name Sensor name
measurement_id Measured value id
measurement_name Name of measured value
measurement_unit Unit of measurement

Example request

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

{
    "code": "0",
    "data": [
        {
            "sensor_type": "1001",
            "sensor_name": "SenseCAP AirTemp&Humi Sensor",
            "sensor_measurement": [
                {
                    "measurement_id": "4097",
                    "measurement_name": "Air Temperature",
                    "measurement_unit": "℃"
                },
                {
                    "measurement_id": "4098",
                    "measurement_name": "Air Humidity",
                    "measurement_unit": "%RH"
                }
            ]
        },
        ...
    ]
}

check device eui and code

POST
{host}/device/check_eui
Body Parameters
eui
(required)
string
device eui
code
(required)
string
device code

response

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

Example request

curl --request POST \
     --url '{host}/device/check_eui' \
     --user '<username>:<password>' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --data '{"code":"device code","eui":"device eui"}' \
     --include

bind device

POST
{host}/device/bind
bind device to account
Body Parameters
eui
(required)
string
device eui
code
(required)
string
device code
device_name
string
device name
group_unique_name
string
group unique name,available through the group list interface
lon
string
device positon, longitude
lat
string
device postion,latitude

response

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

Example request

curl --request POST \
     --url '{host}/device/bind' \
     --user '<username>:<password>' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --data '{"code":"device code","eui":"device eui"}' \
     --include