Appearance
Data Format Definition
This section outlines the data format of each message type defined in "Data Format Overview".
Current Version: V 1.0.0.
Online/Offline Event
Device status information such as online, offline, and reconnection.
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | Device online | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"productKey": "p12345",
"deviceKey": "1234567890",
"type": "ONLINE",
"createdAt": 1609316592000,
"ticket": "5f9924d171977c33bc5ad1b1",
"gateway": {
"productKey": "p12344",
"deviceKey": "1234567891"
},
"data": {
"value": 1
}
}
Device and Module Status
Device and module status information such as battery level, voltage, signal strength, version, ICCID, etc.
Field | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | |||||||||
deviceKey | String | DeviceKey | |||||||||
type | Enum | Device and module status | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | |||||||||
ticket | String | Ticket ID | |||||||||
gateway | JSON Object | Gateway details | |||||||||
| |||||||||||
data | JSON Object | ||||||||||
|
Example:
json
{
"productKey": "p12345",
"deviceKey": "1234567890",
"type": "STATUS",
"createdAt": 1609316592000,
"ticket": "5f9924d171977c33bc5ad1b1",
"data": {
"packetId": 3,
"kv": {"battery": "20", "voltage": "4"}
}
}
List of Status Fields
Category | Name | Key |
---|---|---|
Device Status | Battery Level | battery |
Voltage | voltage | |
Signal Strength | signal_strength | |
Free Memory Left | memory_free | |
Reference Signal Received Power | rsrp | |
LTE Reference Signal Received Quality | rsrq | |
Signal to Interference plus Noise Ratio | snr | |
Module Status | Module Model | type |
Firmware Version | version | |
MCU Version | mcu_version | |
Basestation ID | cell_id | |
ICCID | icc_id | |
Mobile Country Code | mcc | |
Mobile Network Code | mnc | |
Location Area Code | lac | |
Phone Number | phone_num | |
SIM Card Number | sim_num | |
SDK Version | sdk_ver | |
Positioning Support Feature | locator |
Device Command Response Data
The status information of commands issued to the device, including statuses such as success and failure.
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | REQACK | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID generated by Snowflake algorithm. | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"productKey": "p12345",
"deviceKey": "1234567890",
"type": "REQACK",
"createdAt": 1609316592000,
"ticket": "23924d171977c121325ad1bf",
"gateway": {
"productKey": "p12344",
"deviceKey": "1234567891"
},
"data": {
"sentAt": 1609316592000,
"status": "succ"
}
}
Device Information Change
Information about changes to the device, such as addition, modification, deletion, reset, authentication, activation, and de-registration.
Field | Name | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | Event type | String | Y | Fixed to META_EVENT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
ticket | Ticket ID | String | N | This field is required if the operation type is activation, authentication or de-registration. Otherwise, it is optional. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
subtype | Type of operation object | String | Y | Fixed to DEVICE, which indicates that the operation applies to device. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
operation | Specific operation | String | Y | ADD - Add a device UPDATE - Update device information DELETE - Delete a device RESET - Reset a device AUTH - Authenticate a device ACTIVE - Activate a device LOGOFF - Deregister a device | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
productKey | ProductKey | String | Y | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
deviceKey | DeviceKey | String | Y | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | Timestamp of the operation | Long | Y | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
gateway | Gateway information | JSON Object | N | Gateway information displayed during operations such as resetting/authenticating/deregistering gateway sub-devices. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | JSON Object | N | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add/Delete/Activate/Authenticate/Deregister a Device
|
Example of adding/deleting a device:
json
{
"productKey": "p11376",
"deviceKey": "132456",
"type": "META_EVENT",
"subtype": "DEVICE",
"operation": "ADD/DELETE",
"createdAt": 1616375484482,
"ticket": "1032330579905388544",
"data": {
"deviceName": "123789",
"sn": null
}
}
Example of activating/authenticating/de-registering a device:
json
{
"productKey": "p11376",
"deviceKey": "132456",
"type": "META_EVENT",
"subtype": "DEVICE",
"ticket": "1032330579905388544",
"operation": "AUTH/ACTIVEL/LOGOFF",
"createdAt": 1616375484482,
"gateway": {
"productKey": "p11371",
"deviceKey": "112456"
},
"data": null
}
Example of modifying a device:
json
{
"productKey": "p11376",
"deviceKey": "132456",
"type": "META_EVENT",
"subtype": "DEVICE",
"operation": "UPDATE",
"createdAt": 1616375484482,
"ticket": "1032330579905388544",
"data": {
"deviceName": {
"old": "Previous device name",
"new": "New device name"
},
"sn": {
"new": "New SN"
},
"timeOffset": {
"old": "+06:00",
"new": "+08:00"
}
}
}
Example of resetting a device:
json
{
"productKey": "p11376",
"deviceKey": "132456",
"type": "META_EVENT",
"subtype": "DEVICE",
"operation": "RESET",
"createdAt": 1616375484482,
"data": null,
"ticket": "1032330579905388544",
"gateway": {
"productKey": "p11371",
"deviceKey": "112456"
}
}
Device Binding Information Change
Data triggered by changes to end-user device binding information.
Field | Name | Type | Required | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | ProductKey | String | Y | |||||||||||||||||||||||||
deviceKey | DeviceKey | String | Y | |||||||||||||||||||||||||
deviceName | Device name | String | N | |||||||||||||||||||||||||
type | Type | String | Y | Fixed to ENDUSER | ||||||||||||||||||||||||
subtype | Sub-type | String | Y | Fixed to USER-BIND | ||||||||||||||||||||||||
ticket | Ticket ID | String | Y | |||||||||||||||||||||||||
createdAt | Creation time | Long | Y | Operation timestamp. Unit: ms | ||||||||||||||||||||||||
data | JSON Object | Y | ||||||||||||||||||||||||||
|
Example:
json
{
"type": "ENDUSER",
"subtype": "USER-BIND",
"deviceKey": "132456",
"productKey": "p11376",
"createdAt": 1616375484482,
"deviceName": "device",
"ticket": "23924d171977c121325ad1bf",
"data": {
"endUserId": "11376",
"endUserDomain": "C.DM.5715.1",
"value":1
}
}
Transparent Transmission - Uplink Device Data
Device data reported through the transparent transmission channel under the products using either TSL model or the transparent transmission data format.
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | RAW | Y | |||||||||
subtype | Enum | UPLINK | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
ticket | String | Ticket ID | Y | |||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "RAW",
"subtype": "UPLINK",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"data": {
"packetId": 3,
"raw": "YSBtZXNzYWdl"
}
}
Transparent Transmission - Downlink Device Data
Downlink control command data sent through the transparent transmission channel under the product using either TSL model or transparent transmission data format.
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | RAW | Y | |||||||||
subtype | Enum | DOWNLINK | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "RAW",
"subtype": "DOWNLINK",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"data": {
"raw": "YSBtZXNzYWdl"
}
}
TSL Model - Property
Device uplink and downlink data for the product using the TSL model data format.
**MATTR READ: TSL Model-**Read Command (Downlink)
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | MATTR | Y | |||||||||
subtype | Enum | READ | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MATTR",
"subtype": "READ",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"data": {
"keys": [
"code1",
"code2"
]
}
}
**MATTR READRESP: TSL Model - **Response to Read Command
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | MATTR | Y | |||||||||
subtype | Enum | READRESP | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MATTR",
"subtype": "READRESP",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"data": {
"packetId": 3,
"kv": {
"numberKey": "10.2",
"boolKey": true,
"enumKey": "1"
}
}
}
Description: When the Developer Center pushes messages, the numeric field values (defined in the TSL model as INT, FLOAT, DOUBLE, and ENUM) are all pushed as strings. The recipient can convert the values to a numeric format as needed based on the TSL model definition.
**MATTR WRITE: TSL Model - **Write Command (Downlink)
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | MATTR | Y | |||||||||
subtype | Enum | WRITE | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MATTR",
"subtype": "WRITE",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"data": {
"kv": {
"code1": "1",
"code2": "3"
}
}
}
MATTR REPORT: TSL Model - Report
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | MATTR | Y | |||||||||
subtype | Enum | REPORT | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
extData | JSON Object | Reserved feature information, which is in key-value pair format. | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MATTR",
"subtype": "REPORT",
"createdAt": 1609316592000,
"ticket": "5f9924d171977c33bc5ad1b1",
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"extData": {
"occurredAt": "1652433712899"
},
"data": {
"packetId": 5,
"kv": {
"numberKey": "10.2",
"boolKey": true,
"enumKey": "1"
}
}
}
Description: When the Developer Center pushes messages, the numeric field values (defined in the TSL model as INT, FLOAT, DOUBLE, and ENUM) are all pushed as strings. The recipient can convert the values to a numeric format as needed based on the TSL model definition.
TSL Model - Device Uplink Transparent Transmission Data
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | RAW | Y | |||||||||
subtype | Enum | UPLINK | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
ticket | String | Message ID | Y | |||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "RAW",
"subtype": "UPLINK",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"data": {
"packetId": 3,
"raw": "YSBtZXNzYWdl"
}
}
Description: The transparent transmission data value is Base64 encoded.
TSL Model - Device Downlink Transparent Transmission Data
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | |||||||||
deviceKey | String | DeviceKey | Y | |||||||||
type | Enum | RAW | Y | |||||||||
subtype | Enum | DOWNLINK | Y | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | |||||||||
ticket | String | Ticket ID | Y | |||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | Y | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "RAW",
"subtype": "DOWNLINK",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"data": {
"raw": "YSBtZXNzYWdl"
}
}
Description: The transparent transmission data value is Base64 encoded.
TSL Model - Event Reporting - Information
Event information reported by devices under the product that uses the TSL data format and defines the level as INFO.
Field | Type | Description | Required | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | ||||||||||||
deviceKey | String | DeviceKey | Y | ||||||||||||
type | Enum | MEVENT | Y | ||||||||||||
subtype | Enum | INFO | Y | ||||||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | ||||||||||||
ticket | String | Ticket ID | Y | ||||||||||||
gateway | JSON Object | Gateway details | N | ||||||||||||
| |||||||||||||||
extData | JSON Object | Reserved feature information, which is in key-value pair format. | N | ||||||||||||
| |||||||||||||||
data | JSON Object | Y | |||||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MEVENT",
"subtype": "INFO",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"extData": {
"occurredAt": "1652433712899"
},
"data": {
"packetId": 3,
"code": "event_code3",
"kv": {
"numberKey": "0.26",
"boolKey": true,
"enumKey": "1"
}
}
}
Description: When the Developer Center pushes messages, the numeric field values (defined in the TSL model as INT, FLOAT, DOUBLE, and ENUM) are all pushed as strings. The recipient can convert the values to a numeric format as needed based on the TSL model definition.
TSL Model - Event Reporting - Alert
Select event information reported by devices under products that use the TSL model data format and define the level as WARN.
Field | Type | Description | Required | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | ||||||||||||
deviceKey | String | DeviceKey | Y | ||||||||||||
type | Enum | MEVENT | Y | ||||||||||||
subtype | Enum | WARN | Y | ||||||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | ||||||||||||
ticket | String | Ticket ID | Y | ||||||||||||
gateway | JSON Object | Gateway details | N | ||||||||||||
| |||||||||||||||
extData | JSON Object | Reserved feature information, which is in key-value pair format. | N | ||||||||||||
| |||||||||||||||
data | JSON Object | Y | |||||||||||||
|
Example
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MEVENT",
"subtype": "ERROR",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"extData": {
"occurredAt": "1652433712899"
},
"data": {
"packetId": 3,
"code": "event_code3",
"kv": {
"numberKey": "10.3",
"boolKey": true,
"enumKey": "1"
}
}
}
Description: When the Developer Center pushes messages, the numeric field values (defined in the TSL model as INT, FLOAT, DOUBLE, and ENUM) are all pushed as strings. The recipient can convert the values to a numeric format as needed based on the TSL model definition.
TSL Model - Event Reporting - Fault
Event information reported by devices under the product that uses the TSL model data format and defines the level as ERROR.
Field | Type | Description | Required | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | ||||||||||||
deviceKey | String | DeviceKey | Y | ||||||||||||
type | Enum | MEVENT | Y | ||||||||||||
subtype | Enum | ERROR | Y | ||||||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | ||||||||||||
ticket | String | Ticket ID | Y | ||||||||||||
gateway | JSON Object | Gateway details | N | ||||||||||||
| |||||||||||||||
extData | JSON Object | Reserved feature information, which is in key-value pair format. | N | ||||||||||||
| |||||||||||||||
data | JSON Object | Y | |||||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MEVENT",
"subtype": "ERROR",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": " 2345678901234"
},
"extData": {
"occurredAt": "1652433712899"
},
"data": {
"packetId": 3,
"code": "event_code3",
"kv": {
"numberKey": "10.3",
"boolKey": true,
"enumKey": "1"
}
}
}
Description: When the Developer Center pushes messages, the numeric field values (defined in the TSL model as INT, FLOAT, DOUBLE, and ENUM) are all pushed as strings. The recipient can convert the values to a numeric format as needed based on the TSL model definition.
TSL Model - Service Calling Logs
The service data sent by devices under the product that uses the TSL model data format.
Field | Type | Description | Required | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | Y | ||||||||||||
deviceKey | String | DeviceKey | Y | ||||||||||||
type | Enum | MSERV | Y | ||||||||||||
subtype | Enum | INPUT/OUTPUT | Y | ||||||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | Y | ||||||||||||
ticket | String | Ticket ID | Y | ||||||||||||
gateway | JSON Object | Gateway details | N | ||||||||||||
| |||||||||||||||
extData | JSON Object | Reserved feature information, which is in key-value pair format. | N | ||||||||||||
| |||||||||||||||
data | JSON Object | Y | |||||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "MSERV",
"subtype": "INPUT",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p111KY",
"deviceKey": "2345678901234"
},
"extData": {
"occurredAt": "1652433712899"
},
"data": {
"packetId": 3,
"code": "serv_code",
"kv": {
"numberKey": "12",
"boolKey": false
}
}
}
Description: When the Developer Center pushes messages, the numeric field values (defined in the TSL model as INT, FLOAT, DOUBLE, and ENUM) are all pushed as strings. The recipient can convert the values to a numeric format as needed based on the TSL model definition.
Device Positioning - Query Positioning Information
The sent downlink data of device positioning.
Field | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | |||||||||
deviceKey | String | DeviceKey | |||||||||
type | Enum | LOCATION | |||||||||
subtype | Enum | QUERY | |||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | |||||||||
ticket | String | Ticket ID | |||||||||
data | JSON Object | ||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "LOCATION",
"subtype": "QUERY",
"createdAt": 1609316592000,
"data": {
"packetId": 1,
"keys": []
}
}
Device Positioning - Raw Data
Device-reported positioning data based on NMEA protocol.
Field | Type | Description | Required | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | ||||||||||
deviceKey | String | DeviceKey | ||||||||||
type | Enum | LOCATION | ||||||||||
subtype | Enum | INFO-RAW | ||||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | ||||||||||
ticket | String | Ticket ID | ||||||||||
gateway | JSON Object | Gateway details | N | |||||||||
| ||||||||||||
data | JSON Object | |||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "LOCATION",
"subtype": "INFO-RAW",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p12344",
"deviceKey": "1234567891"
},
"data": {
"packetId": 5,
"raw": [
"$GNGGA,095528.000,2318.1133,N,11319.7210,E,1,06,3.7,55.1,M,-5.4,M,,0000*69",
"$BDGGA,062938.00,3110.4700719,N,12123.2657056,E,1,25,0.6,58.9666,M,0.000,M,99,AAAA*4"
]
}
}
Device Positioning Information
The positioning data reported by the device is parsed by Developer Center based on the NMEA protocol.
The device positioning data supports two methods: GPS and LBS. By default, only GPS data is pushed. If LBS data is required, please contact our sales team.
If the returned data is in array format, it will be sent as multiple INFO-KV entries.
Field | Type | Description | Required | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
productKey | String | ProductKey | ||||||||||||||||
deviceKey | String | DeviceKey | ||||||||||||||||
type | Enum | LOCATION | ||||||||||||||||
subtype | Enum | INFO-KV reports raw or non-raw positioning data. | ||||||||||||||||
createdAt | Long | Integer type. Timestamp indicating the exact time the message was generated. Unit: ms. | ||||||||||||||||
ticket | String | Ticket ID | ||||||||||||||||
gateway | JSON Object | Gateway details | N | |||||||||||||||
| ||||||||||||||||||
data | JSON Object | |||||||||||||||||
|
Example:
json
{
"ticket": "5f9924d171977c33bc5ad1b1",
"productKey": "p111KY",
"deviceKey": "1234567890123",
"type": "LOCATION",
"subtype": "INFO-KV",
"createdAt": 1609316592000,
"gateway": {
"productKey": "p12344",
"deviceKey": "1234567891"
},
"data": {
"packetId": 5,
"type": "GP/LBS",
"subType": "BD(GGA)/LBS",
"kv": {
"satellites": "40", //The number of currently used satellites.
"ggaStatus": "4", //Fix quality (GGA-specific)
"lat": "3959.6107085", //Latitude (Unit: ddmm.mmmmmmm)
"lng": "11619.6423341", //Longitude (Unit: ddmm.mmmmmmm)
"wgs_84": {
"lat": 39.99351180833333, //Latitude (Unit: degree)
"lng": 116.32737223500001 //Longitude (Unit: degree)
},
"gcj_02": {
"lat": 39.994825423430167, //Latitude (Unit: degree)
"lng": 116.33351545721269 //Longitude (Unit: degree)
},
"bd_09": {
"lat": 40.00050264255087, //Latitude (Unit: degree)
"lng": 116.340146904483 //Longitude (Unit: degree)
},
"latType": "N/S", //Latitude hemisphere
"lngType": "W/E", //Longitude hemisphere
"hdop": "0.99", //Horizontal dilution of precision
"accuracy": "550", //Accuracy, which is available only for LBS.
"locateTime": 1609316592000, //Positioning time (UTC time).
"height": "66.7717" //Altitude (in meters)
}
}
}
Product Information Change
Changes in product information: addition, modification, or deletion.
Field | Name | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | Event type | String | Y | Fixed to META_EVENT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
subtype | Operation object type | String | Y | Fixed to PRODUCT, indicating that the operation applies to product. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operation | Specific operation | String | Y | ADD - Add a product UPDATE - Update product information DELETE - Delete a product | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
productKey | ProductKey | String | Y | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | Operation timestamp | Long | Y | Operation timestamp (Unit: ms) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | JSON Object | Y | Product details | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add/Delete a Product
|
Example of adding a product:
json
{
"type": "META_EVENT",
"subtype": "PRODUCT",
"operation": "ADD",
"createdAt": 1616375484482,
"operator": 1,
"operatorType": 1,
"productKey": "p00001",
"data": {
"productName": "Product Sample",
"productType": 0,
"accessType": 1,
"netWay": "1",
"dataFmt": 1,
"protocol": 1,
"logoPath": "https://xxxx.com/abcdfg.jpeg",
"moduleType": null,
"moduleName": null,
"moduleId": null,
"allowedLimit": 3,
"productStatus": 0,
"projectId": 1,
"createTime": 1615787274000,
"updateTime": 1615789235000,
"itemCode": "anfang"
}
}
Example of modifying a product:
json
{
"type": "META_EVENT",
"subtype": "PRODUCT",
"operation": "UPDATE",
"createdAt": 1616375484482,
"operator": 1,
"operatorType": 1,
"productKey": "p00001",
"data": {
"productName": {
"old": "Previous product name",
"new": "New product name"
}
}
}
Product Authorization Information
Changes in product authorization information: authorization or authorization cancellation.
Field | Name | Type | Required | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | Event type | String | Y | Fixed to META_EVENT | |||||||||||||||||||||||||||||||||||||||||||||||||||
subtype | Operation object type | String | Y | Fixed to GRANT_AUTHORIZED, indicating product authorization operations. | |||||||||||||||||||||||||||||||||||||||||||||||||||
operation | Specific operation | String | Y | AUTH - Authorize a product CANCEL_AUTH - Deauthorize a product | |||||||||||||||||||||||||||||||||||||||||||||||||||
ProductKey | ProductKey | String | Y | ||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | Operation timestamp | Long | Y | Operation timestamp (Unit: ms) | |||||||||||||||||||||||||||||||||||||||||||||||||||
data | JSON Object | Y | Product authorization details | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Product Authorization/Authorization Cancellation
|
Example of product authorization:
json
{
"createdAt": 1665280943221,
"data": {
"moduleType": null,
"dataFmt": 3,
"itemCode": "socket",
"logoPath": null,
"moduleName": null,
"netWay": "2",
"productStatus": 0,
"allowedLimit": 100,
"updateTime": 1665286595000,
"productName": "socket",
"accessType": 0,
"protocol": null,
"createTime": 1665285584000,
"moduleId": null,
"projectId": 11338,
"productType": 0
},
"operation": "AUTH",
"productKey": "p119Cx",
"subtype": "GRANT_AUTHORIZED",
"type": "META_EVENT"
}
User domain (App) Authorization Information
Changes in User domain (App) authorization information: authorization or authorization cancellation.
Field | Name | Type | Required | Description | ||||||
---|---|---|---|---|---|---|---|---|---|---|
type | Event type | String | Y | Fixed to META_EVENT | ||||||
subtype | Operation object type | String | Y | Fixed to GRANT_USER_DOMAIN | ||||||
operation | Specific operation | String | Y | AUTH - Authorize a User domain(App) CANCEL_AUTH - Deauthorize a User domain (App) | ||||||
userDomain | User domain (App) | String | Y | |||||||
userDomainId | User domain ID | Long | Y | |||||||
createdAt | Operation timestamp | Long | Y | Operation timestamp (Unit: ms) | ||||||
data | JSON Object | Y | App authorization details | |||||||
|
json
{
"type": "META_EVENT",
"subtype": "GRANT_USER_DOMAIN",
"operation": "AUTH",
"userDomain": "C.DM.5503.34",
"userDomainId": 12345645656456,
"createdAt": 1665280943221,
"data": {
"appName": "test"
}
}
TSL Model Release Information Change
Newly-released TSL model information.
Field | Name | Type | Required | Description | ||||||
---|---|---|---|---|---|---|---|---|---|---|
subtype | Operation object type | String | Y | Fixed to THING_MODEL indicating that the operation subject applies to a TSL model. | ||||||
operation | Specific operation | String | Y | RELEASE- Release the TSL model | ||||||
ProductKey | PK | String | Y | |||||||
createdAt | Operation timestamp | Long | Y | Operation timestamp (Unit: ms) | ||||||
data | String | Y | ||||||||
type | Event type | JSON Object | Y | Fixed to META_EVENT | ||||||
|
Example:
json
{
"type": "META_EVENT",
"subtype": "THING_MODEL",
"operation": "RELEASE",
"productKey": "p11374",
"operator": 26984,
"operatorType": 1,
"createdAt": 1616375484482,
"data": {
"tslJson": {
"profile": {
"version": "20210406093313373",
"productKey": "p1137H"
},
"properties": [
{
"code": "202104011545",
"dataType": "BOOL",
"desc": "",
"id": 1,
"name": "202104011545",
"specs": [
{
"dataType": "BOOL",
"name": "TRUE",
"value": "true"
},
{
"dataType": "BOOL",
"name": "FALSE",
"value": "false"
}
],
"subType": "RW",
"type": "PROPERTY"
},
{
"code": "202104011700",
"dataType": "DOUBLE",
"desc": "",
"id": 2,
"name": "202104011700",
"specs": {
"max": "2",
"min": "1",
"step": "1",
"unit": "°"
},
"subType": "RW",
"type": "PROPERTY"
},
{
"code": "202104011501",
"dataType": "TEXT",
"desc": "",
"id": 3,
"name": "202104011501",
"specs": {
"length": 123
},
"subType": "RW",
"type": "PROPERTY"
}
]
}
}
}
End-user Information Change
Changes in end-user information: creation, modification, or deletion.
End-user information changes require creating end-user subscriptions via OpenAPI.
Field | Name | Type | Required | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | Event type | String | Y | Fixed to ENDUSER | ||||||||||||||||||||||||
subtype | Subtype | String | Y | USER-ADD - Add an end-user USER-UPDATE - Update end-user's information USER-DELETE - Delete an end-user | ||||||||||||||||||||||||
ticket | Ticket ID | String | Y | Unique message code | ||||||||||||||||||||||||
createdAt | Creation time | Long | Y | Operation timestamp (Unit: ms) | ||||||||||||||||||||||||
data | JSON Object | Y | ||||||||||||||||||||||||||
|
Example:
json
{
"ticket": "b18be821-5045-4467-801d-ca68c302dc3d",
"type": "ENDUSER",
"subtype": "USER-DELETE",
"createdAt": 1642471712433,
"data": {
"endUserId": "C1",
"endUserDomain": "C.DM.1.15"
}
}
Rule Engine Event
Rule engine push messages.
Field | Name | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | Event type | String | Y | Fixed to CEP_RULE. | ||||||||||||||||||||||||||||||||||||||
subtype | Subtype | String | Y | Fixed to NOTICE. | ||||||||||||||||||||||||||||||||||||||
traceId | Action trace ID | String | Y | Action trace ID. | ||||||||||||||||||||||||||||||||||||||
createdAt | Creation Time | Long | Y | Operation timestamp. Unit: ms. | ||||||||||||||||||||||||||||||||||||||
data | JSON Object | Y | ||||||||||||||||||||||||||||||||||||||||
|
Example:
json
{
"traceId": "1228299096116822016",
"type": "CEP_RULE",
"subtype": "NOTICE",
"createdAt": 1713249972992,
"data": {
"extra": "{\"key\",\"value\"}",
"raw": {
"ticket": "1228217775206039552",
"productKey": "p113C1",
"deviceKey": "8686202300000001",
"type": "MATTR",
"createdAt": 1713249972997,
"attrs": {
"kv": {
"Temperature": 50,
"struct": {
"date": 1690449531456
},
"array_int": [1],
"array_struct": [
{
"date": "1690449531456"
}
]
}
},
"events": [
{
"code": "BatteryWarning",
"kv": {
"Temperature": 50,
"struct": {
"date": 1690449531456
},
"array_int": [1],
"array_struct": [
{
"date": "1690449531456"
}
]
}
}
]
}
}
}