Device Data API-V1

list device EUIs

GET {host}/1.0/lists/devices/eui

this is a quick method to get all device EUIs belonging to the organization

{
    "code": "0",
    "data": {
        "gateway": [
            "2CF7F1........",
            "2CF7F1........",
            "2CF7F1........"
        ],
        "node": [
            "2CF7F1........",
            "2CF7F1........",
            "2CF7F1........",
            "2CF7F1........",
            "2CF7F1........"
        ]
    }
}

Example request

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

get the latest data of the device

GET {host}/1.0/devices/data/:node_eui/latest

Path Parameters

Name
Type
Description

node_eui

string

Node EUI

Query Parameters

Name
Type
Description

measure_id

string

sensor measurement ID, eg. measure_id=4097

channel

string

query data from this channel, if omitted, measurements of all channels will be returned

{
    "code": "0",
    "data": [
        {
            "channel": "32", // channel number
            "points": [
                {
                    "value": "185", // the measurement value
                    "measurement_id": "4104", // the measurement id
                    "created": "1585207708575" // when the record is created 
                }
            ]
        }
    ]
}

Example request

curl --request GET \
     --url {host}/1.0/devices/data/:node_eui/latest?measure_id:measure_id&channel:channel \
     --user '<username>:<password>' \
     --include

get the history data of the device

GET {host}/1.0/devices/data/:node_eui/raw

Get the history data of a specified node.

Path Parameters

Name
Type
Description

node_eui

string

Node EUI

Query Parameters

Name
Type
Description

measure_id

string

the sensor measurement ID, eg. measure_id=4087

channel

string

query data from this channel, if omitted, data points of all channels will be returned

limit

number

the number of records you want to query, max is 400

time_start

number

timestamp, unit millisecond

time_end

number

timestamp, unit millisecond

{
    "code": "0",
    "data": [
        {
            "channel": "1", // channale number
            "points": [
                {
                    "measurement_id": "4099", // the measurement id
                    "value": "0",  // measurement value
                    "created": "1585207694901" // when the record is created 
                },
                {
                    "measurement_id": "4099",
                    "value": "0",
                    "created": "1585207626265"
                }
            ],
            "channel_name": ""
        },
        {
            "channel": "2",
            "points": [
                {
                    "measurement_id": "4102",
                    "value": "25.7",
                    "created": "1585207695572"
                },
                {
                    "measurement_id": "4103",
                    "value": "0.0",
                    "created": "1585207695572"
                }
            ],
            "channel_name": ""
        }
    ]
}

Example request

curl --request GET \
  --url {host}/1.0/devices/data/:node_eui/raw?limit=:limit&time_start=:time_start&time_end=:time_end \
  --user '<username>:<password>' \
  --include

get the segment data of the device

GET {host}/1.0/devices/data/:node_eui/segment

Segment a huge data set into small ones, then output the average value of each small segment. The small segment is described with time length, e.g. 60 minutes.

Path Parameters

Name
Type
Description

node_eui

string

Node EUI

Query Parameters

Name
Type
Description

measure_id

string

sensor measurement ID, eg. measure_id=4098

channel

string

query data from this channel, if omitted, data points of all channels will be returned

segment

string

time length of segment, unit minute

time_start

string

timestamp, unit millisecond

time_end

string

timestamp, unit millisecond

{
    "code": "0",
    "data": [
        {
            "channel": "1", // channel number
            "lists": [
                {
                    "avg": "9.72",  // avgrage value of the segment
                    "measurement_id": "4099", // the measurement id
                    "created": "1556051760000"
                },
                {
                    "avg": "6.07",
                    "measurement_id": "4099",
                    "created": "1556177940000"
                }
            ]
        }
    ]
}

Example request

curl --request GET \
  --url {host}/1.0/devices/data/:node_eui/segment?measure_id:measure_id&channel:channel&segment:segment&time_start:time_start&time_end:time_end \
  --user '<username>:<password>' \
  --include

Last updated