Skip to main content

API Core Functions

Overview

This Open Platform API provides end-to-end services for device time-series data and data warehouse data, supporting identity authentication through a secure RSA token encryption mechanism. Core functions cover device data push, detail query, real-time and historical point data acquisition, as well as dataset import and query, providing standardized, secure, and reliable data interfaces for third-party system integration.

tip

Time-series Data: A series of data points with timestamps, used to describe the state or measured value of a device at a specific point in time. It is the most common data type in the Internet of Things field.

Data Warehouse Data: Business data or master data stored in a data warehouse, usually cleaned and aggregated, suitable for more complex analysis and reporting.

Before You Start

Permission Configuration

To ensure the following operational processes proceed normally, please confirm that you have Project Administrator permissions.

Token Encryption Transmission Guide

This guide aims to provide detailed instructions on how to securely use the RSA encryption algorithm for token encryption transmission within our open platform. By following this guide, you will be able to ensure the highest level of protection for sensitive data during transmission between client and server.
For specific operations, see below ->

Token Encryption Process

  • Generate Key Pair
    Developers need to apply for a token within the platform application. The system will generate a key pair, and developers can download the token information (including Key ID, Key, and Public Key). The downloaded information will be used to encrypt the token, while the private key is used for decryption.
  • Token Application and Download
    1. Enter Device Management
      Access Device Management; for operations, see Device Management
    2. Token Application and Download
      Add or download tokens; for operations, see Token Download
  • API Interface Description
    tip

    Ciphertext refers to scrambled data processed by an encryption algorithm that cannot be directly read or understood. In contrast, Plaintext is the original, readable data before encryption.

    The system encrypts the token (Token) information obtained through security mechanisms using the RSA encryption algorithm, generating an encrypted ciphertext. This ciphertext is then embedded into the HTTP header of the API (Application Programming Interface) request as part of the authentication or authorization information, subsequently initiating the API request. This process ensures the confidentiality and security of token information during transmission, preventing the leakage of sensitive information (for encryption methods, please refer to the example code below).

Example Code

Python Example File

JAVA Example File

Golang Example File

.Net Example File

Node.js Example File

Common Request Error Codes

CodeDescription
401Access token expired, needs renewal
404Incorrect interface address
428User or tenant does not exist
429User not registered
500Internal server error
503Service busy, please try again later
1000Data *** already exists

Device Time-Series Data

Device Time-Series Data Push

tip

Can access time-series data reported by devices. Multiple devices can be pushed at once, but the total number of data entries in a single request must not exceed 1000.

URL:{neuron domain}/neurongateway/openapi/dataPlatform/openapi

HTTP Method: Post

Request Body Type: Array

Authentication: Request Header Field Description (for encryption method, see API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringHeaderYesKey ID
X-Source-SecretKeystringHeaderYesKey Encrypted Text

Single Object in Array Description:

Field NameField TypeRequiredDescription
timestringNoDevice data collection time
equipmentNamestringYesDevice name
functionTypestringYesDevice point name
buildingNamestringYesBuilding name where the device is located (Must be consistent with the building name used during device registration)
devEuistringNoIoT device unique identifier
valuedoubleNoDevice point numeric value (Choose either value or reading)
readingstringNoDevice point string value (Choose either value or reading)
unitstringNoDevice point unit

Return Result Field Description

Field NameField TypeDescription
codeintRequest response code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True on success, False on failure

Return Error Codes

See Common Request Error Codes

Device Details Query

tip

Can query detailed information for a single device.

URL: {neuron domain}/neurongateway/openapi/device/v1/mn/{devEui}

HTTP Method: Get

Authentication: Request Header Field Description (for encryption method, see API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringHeaderYesKey ID
X-Source-SecretKeystringHeaderYesKey Encrypted Text

Request Parameters

Field NameField TypeRequiredDescription
devEuistringYesIoT device unique identifier

Return Result Field Description

Field NameField TypeDescription
codeintRequest response code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True on success, False on failure
dataobjectDevice details object

Device Details Data Object Field Description

Field NameDescription
nameDevice name
aliasDevice alias
equModelDevice thing model
pointsDevice point information corresponding to a single device (single object field description under device points)
devEUIIoT device unique identifier
locationDevice registration location information
isOnlineWhether the device is online (True means online, False means offline)
descriptionsDevice description
isIotWhether it is an IoT device (True for IoT device, False for non-IoT device)
buildingNameDevice registration building name

Single Object Field Description in Device Details Points Array

Field NameDescription
typeDevice point name
unitDevice point unit
bmsIdNon-IoT device point ID
controlWhether reverse control is supported (True for controllable, False for not controllable)

Return Error Codes

See Common Request Error Codes

Device List Query

tip

Can query all device information viewable under the current tenant.

URL: {neuron domain}/neurongateway/openapi/device/v1/mn/page

HTTP Method: Get

Authentication: Request Header Field Description (for encryption method, see API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringHeaderYesKey ID
X-Source-SecretKeystringHeaderYesKey Encrypted Text

Request Parameters

Field NameField TypeRequiredDescription
currentintYesCurrent page
sizeintYesNumber of items per page
namestringNoDevice name (fuzzy match)
devEuistringNoIoT device unique identifier (exact match)
buildingNamestringNoBuilding name filled during device registration (exact match)
equModelstringNoDevice thing model name (exact match)

Return Result Field Description

Field NameField TypeDescription
codeintRequest response code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True on success, False on failure
dataobjectDevice list object (total: total count, size: items per page, current: current page, records: device data)

Single Object Field Description under Device Data Records

Field NameDescription
nameDevice name
aliasDevice alias
equModelDevice thing model
pointsDevice point information corresponding to a single device (single object field description under device points)
devEUIIoT device unique identifier
locationDevice registration location information
isOnlineWhether the device is online (True means online, False means offline)
descriptionsDevice description
isIotWhether it is an IoT device (True for IoT device, False for non-IoT device)
buildingNameDevice registration building name

Single Object Field Description under Device Points

Field NameDescription
typeDevice point name
unitDevice point unit
bmsIdNon-IoT device point ID
controlWhether reverse control is supported (True for controllable, False for not controllable)

Return Error Codes

See Request Error Codes

Device Point Latest Value Query

tip

Can query the latest values of all device points viewable under the current tenant.

URL: {neuron domain}/neurongateway/openapi/device/v1/realtime/{devEui}/values

HTTP Method: Get

Authentication: Request Header Field Description (for encryption method, see API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringHeaderYesKey ID
X-Source-SecretKeystringHeaderYesKey Encrypted Text

Request Parameters

Field NameField TypeRequiredDescription
devEuistringNoIoT device unique identifier (exact match)

Return Result Field Description

Field NameField TypeDescription
codeintRequest response code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True on success, False on failure
dataarrayDevice point latest values

Single Object Field Description in Device Data Array

Field NameDescription
eqNameDevice name
aliasDevice alias
equModelDevice thing model
devEUIIoT device unique identifier
stateDevice Extended Status Codes
isOnlineWhether the device is online (True means online, False means offline)
descriptionsDevice description
pidDevice location information (project)
buildingDevice registration building name
floorDevice registration floor name
roomDevice registration room name
editVosEDevice points List

Return Error Codes

See Request Error Codes

Device Point Historical Value Query

tip

Can query data values for a single or all points under a specific device for a certain period (Time range can only query data within one week).

URL: {neuron domain}/neurongateway/openapi/device/v1/realtime/history

HTTP Method: Post

Authentication: Request Header Field Description (for encryption method, see API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringHeaderYesKey ID
X-Source-SecretKeystringHeaderYesKey Encrypted Text

Request Parameters

Field NameField TypeRequiredDescription
equipmentNamestringYesDevice name (exact match)
functionTypestringNoDevice point name
startTimedatatimeNoStart time
endTimedatatimeNoEnd time
fieldstringYesDevice point value type (VALUE for numeric, READING for string)
equModelstringNoDevice thing model name (exact match)

Return Result Field Description

Field NameField TypeDescription
codeintRequest response code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True on success, False on failure
dataarrayDevice point value object

Single Field Description in Device Data Array

Field NameDescription
timeData collection time
equipmentNameDevice name
buildingNameDevice registration building information
functionTypeSingle device point name
devEUIIoT device unique identifier
valueDevice numeric value
readingDevice string value
unitDevice point unit

Return Error Codes

See Request Error Codes

Data Warehouse Data

Data Push

tip

Can access dataset data (pushed fields and data types must correspond to the dataset configuration). Multiple entries can be pushed at once (Total data entries in a single request must not exceed 1000).

URL: {neuron domain}/neurongateway/openapi/dataset/v1/{templateCode}

HTTP Method: Post

Authentication: Request Header Field Description (for encryption method, see API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringHeaderYesKey ID
X-Source-SecretKeystringHeaderYesKey Encrypted Text
X-Param-ProjectIdstringHeaderYesPlatform Project ID

Request Body Type: Array

Request Parameters

Field NameField TypeRequiredDescription
datasetNamestringYesDataset ID

Return Result Field Description

Field NameField TypeDescription
codeintRequest response code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True on success, False on failure

Return Error Codes

See Request Error Codes

Data Query

tip

Can query data values for a single or all points under a specific device for a certain period (Time range can only query data within one week).

URL: {neuron domain}/neurongateway/openapi/dataset/v1/{templateCode}

HTTP Method: Get

Authentication: Request Header Field Description (for encryption method, see API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringHeaderYesKey ID
X-Source-SecretKeystringHeaderYesKey Encrypted Text
X-Param-ProjectIdstringHeaderYesPlatform Project ID

Request Parameters

Field NameField TypeRequiredDescription
equipmentNamestringYesDevice name (exact match)
functionTypestringNoDevice point name
startTimedatatimeNoStart time
endTimedatatimeNoEnd time
fieldstringYesDevice point value type (VALUE for numeric, READING for string)
equModelstringNoDevice thing model name (exact match)

Return Result Field Description

Field NameField TypeDescription
codeintRequest response code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True on success, False on failure
dataarrayDevice point value object

Single Field Description in Device Data Array

Field NameDescription
timeData collection time
equipmentNameDevice name
buildingNameDevice registration building information
functionTypeSingle device point name
devEUIIoT device unique identifier
valueDevice numeric value
readingDevice string value
unitDevice point unit

Return Error Codes

See Request Error Codes