Skip to main content

OpenAPI Guide

Token Encryption Transmission Guide

This guide provides detailed instructions on securely using the RSA encryption algorithm to encrypt tokens (Token) for transmission within our open platform. Following this guide ensures the highest level of protection for sensitive data during transmission between the client and the server.
Detailed operations can be found below.

Token Encryption Process

  • Generate Key Pair
    Developers need to apply for a token in the platform application. The system generates a key pair, and developers download the token information (including Key ID, Key, and Public Key). This information is used for token encryption, while the private key is used for decryption.
  • Token Application and Download
    1. Access Device Management
      Navigate to Device Management. See Device Management for details.
    2. Apply and Download Token
      Add or download a token. See Token Management for details.
  • API Interface Explanation
    The system securely retrieves the token information and encrypts it using the RSA algorithm to generate a ciphertext. This encrypted ciphertext is included in the HTTP headers of API requests as part of authentication or authorization information. This process ensures confidentiality and prevents sensitive information leakage during transmission. (For encryption methods, refer to the sample code below.)

Sample Code

JAVA Example File

Golang Example File

.Net Example File

Common Request Error Codes

CodeDescription
401Access token expired, requires renewal
404API endpoint error
428User or tenant does not exist
429User not registered
500Internal server error
503Service busy, try again later
1000Data already exists

Device Time-Series Data

Device Time-Series Data Push

tip

You can push time-series data from devices, supporting multiple devices in one request. The total data count per request must not exceed 1,000 records.

URL: /dataPlatform/openapi

HTTP Method: POST

Request Body Type: Array

Authentication: Header fields (encryption methods in API Call Demo)

Field NameTypeRequiredLocationDescription
X-Source-SecretIdstringYesHeaderKey ID
X-Source-SecretKeystringYesHeaderEncrypted Key Text

Array Object Description

Field NameTypeRequiredDescription
timestringNoDevice data collection time
equipmentNamestringYesDevice name
functionTypestringYesDevice function point name
buildingNamestringYesDevice building name (must match the registered building name)
devEuistringNoUnique identifier for IoT devices
valuedoubleNoNumeric value for the function point (either value or reading is required)
readingstringNoString value for the function point (either value or reading is required)
unitstringNoUnit for the function point

Response Field Description

Field NameTypeDescription
codeintResponse code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True if successful, False otherwise

Error Codes

For more details, refer to Common Request Error Codes.

Device Details Query

tip

Retrieve details for a single device.

URL: /device/v1/mn/{devEui}

HTTP Method: GET

Authentication: Header fields (encryption methods in API Call Demo)

Field NameTypeRequiredLocationDescription
X-Source-SecretIdstringYesHeaderKey ID
X-Source-SecretKeystringYesHeaderEncrypted Key Text

Request Parameters

Field NameTypeRequiredDescription
devEuistringYesUnique identifier for IoT devices

Response Field Description

Field NameTypeDescription
codeintResponse code, 200 indicates success
messagestringSystem message
isSuccessbooleanReturns True if successful, False otherwise
dataobjectDevice detail object

Data Object Fields

Field NameDescription
nameDevice name
aliasDevice alias
equModelDevice model
pointsDevice function points (array of objects)
devEUIUnique identifier for IoT devices
locationDevice registration location
isOnlineIndicates if the device is online (True = Online, False = Offline)
descriptionsDevice description
isIotIndicates if the device is IoT (True = IoT, False = Non-IoT)
buildingNameRegistered building name

Points Array in Device Details - Field Description

Field NameDescription
typeDevice point name
unitDevice point unit
bmsIdNon-IoT device point ID
controlIndicates if reverse control is supported (True: supported, False: not supported)

Error Codes

For more details, refer to Common Request Error Codes.

Device List Query

tip

This query retrieves all device information accessible under the current tenant.

URL: /device/v1/mn/page

HTTP Request Method: GET

Authentication: Header Field Description (encryption method detailed in API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringYesHeaderSecret ID
X-Source-SecretKeystringYesHeaderSecret Key Encrypted Text

Request Parameters

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

Response Fields Description

Field NameField TypeDescription
codeintResponse code (200 indicates success)
messagestringSystem message
isSuccessbooleanTrue if successful, False otherwise
dataobjectDevice list object (total: total count, size: items per page, current: current page, records: device data)

Device Data (records) - Field Description

Field NameDescription
nameDevice name
aliasDevice alias
equModelDevice model
pointsDevice point information (see below for individual field descriptions)
devEUIIoT device unique identifier
locationDevice registration location
isOnlineIndicates if the device is online (True: online, False: offline)
descriptionsDevice description
isIotIndicates if it is an IoT device (True: IoT, False: Non-IoT)
buildingNameBuilding name during device registration

Device Points - Individual Field Description

Field NameDescription
typeDevice point name
unitDevice point unit
bmsIdNon-IoT device point ID
controlIndicates if reverse control is supported (True: supported, False: not supported)

Error Codes

For more details, refer to Common Request Error Codes.

Latest Device Point Values Query

tip

Query the latest values of device points accessible under the current tenant.

URL: /device/v1/realtime/{devEui}/values

HTTP Request Method: GET

Authentication: Header Field Description (encryption method detailed in API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringYesHeaderSecret ID
X-Source-SecretKeystringYesHeaderSecret Key Encrypted Text

Request Parameters

Field NameField TypeRequiredDescription
devEuistringNoIoT device unique identifier (exact match)

Response Fields Description

Field NameField TypeDescription
codeintResponse code (200 indicates success)
messagestringSystem message
isSuccessbooleanTrue if successful, False otherwise
dataarrayLatest values of device points

Data - Individual Field Description

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

Error Codes

For more details, refer to Common Request Error Codes.

Device Point Historical Value Query

tip

You can query the data values of a single or all points of a device within a specific time range. (The time range can only query data within the past week)

URL: /device/v1/realtime/history

HTTP Request Method: POST

Authentication: Request Header Field Description (Encryption method detailed in API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringYesHeaderSecret ID
X-Source-SecretKeystringYesHeaderSecret Key Encrypted Text

Request Parameters

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

Response Fields Description

Field NameField TypeDescription
codeintResponse code (200 indicates success)
messagestringSystem message
isSuccessbooleanTrue if successful, False otherwise
dataarrayDevice point value objects

Device Data Array - Field Description

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

Error Codes

For more details, refer to Common Request Error Codes.

Data Warehouse

Data Push

tip

You can push dataset data (fields and data types must match the dataset configuration). Multiple records can be pushed in one request, but the total number of records in a single request cannot exceed 1,000.

URL: /dataset/v1/{datasetName}

HTTP Request Method: POST

Authentication: Request Header Field Description (Encryption method detailed in API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringYesHeaderSecret ID
X-Source-SecretKeystringYesHeaderSecret Key Encrypted Text
X-Param-ProjectIdstringHeaderYesPlatform Project ID

Request Body Type: Array

Request Parameters

Field NameField TypeRequiredDescription
datasetNamestringYesDataset ID

Response Fields Description

Field NameField TypeDescription
codeintResponse code (200 indicates success)
messagestringSystem message
isSuccessbooleanReturns True if successful, False otherwise

Error Codes

For more details, refer to Common Request Error Codes.

Data Query

tip

You can query data values for a single or all points of a device within a specific time range. (The time range can only query data within the past week)

URL: /device/v1/realtime/history

HTTP Request Method: POST

Authentication: Request Header Field Description (Encryption method detailed in API Call Demo)

Field NameField TypeRequiredLocationDescription
X-Source-SecretIdstringYesHeaderSecret ID
X-Source-SecretKeystringYesHeaderSecret Key Encrypted Text
X-Param-ProjectIdstringHeaderYesPlatform Project ID

Request Parameters

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

Response Fields Description

Field NameField TypeDescription
codeintResponse code (200 indicates success)
messagestringSystem message
isSuccessbooleanReturns True if successful, False otherwise
dataarrayDevice point value objects

Device Data Array - Field Description

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

Error Codes

For more details, refer to Common Request Error Codes.