All Products
Search
Document Center

IoT Platform:Data formats

Last Updated:Jun 08, 2026

IoT Platform forwards and subscribes to data based on topic formats. Custom topic formats are user-defined. Basic communication and TSL topic formats are converted during message forwarding. This topic documents each converted format.

Message forwarding and device communication topics

Communication topic definitions and classifications are covered in What is a topic?.

Specify the raw data format during device development:

  • Basic communication and TSL topic data must comply with the Alink protocol, as described in the related documents in the Alink protocol directory.

    After forwarding, the data format is converted. Each converted format is described below.

  • You define the data format for custom topics.

    After forwarding, custom topic data remains unchanged.

The following table maps forwarding topics to their corresponding device communication topics.

Table 1. Topic descriptions

Topic

Description

References

Custom

A topic for forwarding messages in a custom data format follows the same format as a custom topic: /${productKey}/${deviceName}/user/${TopicShortName}.

${TopicShortName} specifies a custom topic category, which is the suffix of the custom topic.

The value can contain wildcard characters, including plus signs (+) and number signs (#).

  • All equipment (+): indicates all devices of the specified product.

  • /user/#: All custom topics for a specified device.

Use custom topics for communication

Device Status Change Notification

The topic that is used to forward notifications when the status of a device changes between online and offline. Format: /as/mqtt/status/${productKey}/${deviceName}.

Device online and offline status

TSL Data Reporting

Includes:

  • A device reports property data to the following topic: /${productKey}/${deviceName}/thing/event/property/post.

  • Event data reported by a device is forwarded to the topic /${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/post.

  • The topic for forwarding batch property data from devices is /${productKey}/${deviceName}/thing/property/batch/post.

  • The topic for forwarding batch event data from devices is /${productKey}/${deviceName}/thing/event/batch/post.

  • A device sends response messages for cloud commands to the following topic: /${productKey}/${deviceName}/thing/downlink/reply/message.

The following topics are used to submit raw device data:

  • /sys/${productKey}/${deviceName}/thing/event/property/post: This topic is used to submit device properties.

  • /sys/${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/post and /sys/${productKey}/${deviceName}/thing/event/${tsl.functionBlockId}:{tsl.event.identifier}/post: These topics are used to submit device events.

  • /sys/${productKey}/${deviceName}/thing/event/property/batch/post: This topic is used to submit device properties and events in batches.

Device Changes Throughout Lifecycle

The topic that is used to forward messages when a device is created, deleted, disabled, or enabled. Format: /${productKey}/${deviceName}/thing/lifecycle.

Changes to the device lifecycle

Sub-Device Data Report Detected by Gateway

The topic /${productKey}/${deviceName}/thing/list/found is used by gateway devices to report information about discovered sub-devices to IoT Platform.

Gateway discovery of sub-devices

Device Topological Relation Changes

The topic that is used to forward notifications when topological relationships between sub-devices and the gateway are created or deleted. This topic is specific to gateways. Format: /${productKey}/${deviceName}/thing/topo/lifecycle.

Device Topological Relation Changes

A device uses the topic /sys/${productKey}/${deviceName}/thing/topo/change to report raw data.

Notify gateways of changes of topological relationships

Device tag change

The topic for forwarding device tag updates is /${productKey}/${deviceName}/thing/deviceinfo/update.

Changes to device tags

A device uses the following topic to report raw data: /sys/${productKey}/${deviceName}/thing/deviceinfo/update.

Submit tags

TSL Historical Data Reporting

Includes:

  • /${productKey}/${deviceName}/thing/event/property/history/post: This topic is used to forward historical properties.

  • /${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/history/post: This topic is used to forward historical events.

/sys/${productKey}/${deviceName}/thing/event/property/history/post: This topic is used to submit historical TSL data.

How to report historical data for a Thing Specification Language model

Device Status Notification for OTA Updates

Includes:

  • The topic for forwarding the OTA update result from a device is /${productKey}/${deviceName}/ota/upgrade.

  • A device reports OTA update progress to the topic /${productKey}/${deviceName}/ota/progress/post.

A device reports its upgrade progress to the following topic: /ota/device/progress/${productKey}/${deviceName}.

Reporting device upgrade progress

Submit a module version number

The topic for reporting an updated Over-the-Air (OTA) module version: /${productKey}/${deviceName}/ota/version/post.

Notice of OTA Module Version Changes

A device uses the following topic to report its OTA module version: /ota/device/inform/${productKey}/${deviceName}.

Device reports the OTA module version

Batch status notification

IoT Platform publishes status change notifications for an OTA update batch to the following topic: /${productKey}/${packageId}/${jobId}/ota/job/status.

Status Notifications for OTA Update Batches

Job Event

Includes the following topics:

  • Device job status notifications: /sys/uid/${uid}/job/${jobId}/lifecycle.

  • Instance migration job status notifications: /sys/uid/${uid}/distribution/${jobId}/lifecycle.

    Note

    The name of the product to be migrated is used as the name of the instance migration job.

Device online and offline status

Topic: /as/mqtt/status/${productKey}/${deviceName}

Reports a device's online or offline status.

Online format:

{
    "status":"online",
    "iotId":"4z819VQHk6VSLmmBJfrf00107e****",
    "productKey":"al12345****",
    "deviceName":"deviceName1234",
    "time":"2018-08-31 15:32:28.205",
    "utcTime":"2018-08-31T07:32:28.205Z",
    "lastTime":"2018-08-31 15:32:28.195",
    "utcLastTime":"2018-08-31T07:32:28.195Z",
    "clientIp":"192.0.2.1"
}

Offline format:

{
    "status":"offline",
    "iotId":"4z819VQHk6VSLmmBJfrf00107e****",
    "offlineReasonCode":427,
    "productKey":"al12345****",
    "deviceName":"deviceName1234",
    "time":"2018-08-31 15:32:28.205",
    "utcTime":"2018-08-31T07:32:28.205Z",
    "lastTime":"2018-08-31 15:32:28.195",
    "utcLastTime":"2018-08-31T07:32:28.195Z",
    "clientIp":"192.0.2.1"
}

Parameter descriptions:

Parameter

Type

Description

status

String

The status of the device.

  • online: Online.

  • offline: Offline.

iotId

String

The unique identifier of the device in IoT Platform.

offlineReasonCode

Integer

The error code when the device goes offline. Device behavior error codes.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

lastTime

String

Deprecated. No longer used.

utcLastTime

String

time

String

The time when the device went online or offline.

Messages are not sorted by online/offline time. Sort them by the time value.

For example, you receive the following three messages in sequence:

  1. Online: 2018-08-31 10:02:28.195.

  2. Offline: 2018-08-31 10:01:28.195.

  3. Offline: 2018-08-31 10:03:28.195.

These three messages show that the device went offline, then online, then offline again.

utcTime

String

The UTC time when the device went online or offline.

clientIp

String

The public IP address of the device.

Submit device properties

Topic: /${productKey}/${deviceName}/thing/event/property/post

Reports properties submitted by a device.

Data format:

{
    "iotId":"4z819VQHk6VSLmmBJfrf00107e****",
    "requestId":"2",
    "productKey":"al12345****",
    "deviceName":"deviceName1234",
    "gmtCreate":1510799670074,
    "deviceType":"Ammeter",
    "items":{
        "Power":{
            "value":"on",
            "time":1510799670074
        },
        "Position":{
            "time":1510292697470,
            "value":{
                "latitude":39.9,
                "longitude":116.38
            }
        }
    },
    "checkFailedData":{
        "attribute_8":{
            "time": 1510292697470,
            "value": 715665571,
            "code":6304,
            "message":"tsl parse: params not exist -> attribute_8"
        }
    }
}

Parameter descriptions:

Parameter

Type

Description

iotId

String

The unique identifier of the device in IoT Platform.

requestId

String

The Id from the raw device message. A numeric string in the range 0 to 4294967295. Must be unique per device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

gmtCreate

Long

The time when the data forwarding message was generated.

deviceType

String

The category of the device.

Set when creating a product (Create a product or CreateProduct).

items

Object

The device data.

Power

String

The property identifier. For property names, see the TSL description of the product.

If the property is a custom module property, the property identifier is in the ${ModuleIdentifier}:${PropertyIdentifier} format (a colon : is used as a separator). For example, if the identifier of a custom TSL model module is test, the data format is:

{
    "items":{
        "test:Power":{
            "value":"on",
            "time":1510799670074
        },
        "test:Position":{
            "time":1510292697470,
            "value":{
                "latitude":39.9,
                "longitude":116.38
            }
        }
    }
}

Position

attribute_8

checkFailedData

Object

The data that fails the TSL model data validation.

value

Defined by TSL

The property value.

time

Long

The time when the property was reported. Defaults to the time when IoT Platform generates the data if not reported by the device.

code

Integer

The error code for TSL validation failures. Error codes for devices.

message

String

The error message returned when data fails TSL model validation, including the failure cause and invalid parameters.

Submit device events

Topic: /${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/post

Reports events submitted by a device.

Data format:

{
    "identifier":"BrokenInfo",
    "name":"Damage Rate Submission",
    "type":"info",
    "iotId":"4z819VQHk6VSLmmBJfrf00107e****",
    "requestId":"2",
    "productKey":"X5eCzh6****",
    "deviceName":"5gJtxDVeGAkaEztpisjX",
    "gmtCreate":1510799670074,
    "value":{
        "Power":"on",
        "Position":{
            "latitude":39.9,
            "longitude":116.38
        }
    },
    "checkFailedData":{},
    "time":1510799670074
}

Parameter descriptions:

Parameter

Type

Description

identifier

String

The identifier of the event.

If the event is a custom module event, the event identifier is in the ${ModuleIdentifier}:${EventIdentifier} format (a colon : is used as a separator). For example, if the identifier of a custom TSL model module is test, the data format is:

"test:identifier":"BrokenInfo",

name

String

The name of the event.

type

String

The event type. For event types, see the TSL description of the product.

iotId

String

The unique identifier of the device in IoT Platform.

requestId

String

The Id from the raw device message. A numeric string in the range 0 to 4294967295. Must be unique per device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

gmtCreate

Long

The time when the data forwarding message was generated.

value

Object

The output parameter information of the event. The example shows information about the two parameters Power and Position.

{
    "Power":"on",
    "Position":{
        "latitude":39.9,
        "longitude":116.38
    }
}
Important
  • Only when all output parameters of the event pass the validation, all output parameters are displayed in the value parameter. In this case, the checkFailedData parameter is empty.

  • If any output parameter of the event fails the validation, all output parameters are displayed in the checkFailedData parameter. In this case, the value parameter is empty.

checkFailedData

Object

The data that fails the TSL model data validation.

If the output parameters of the event fail the validation, the checkFailedData parameter is:

{
    "value":{
        "Power":"on",
        "Position":{
            "latitude":39.9,
            "longitude":116.38
        }
    },
    "time":1524448722000,
    "code":6304,
    "message":"tsl parse: params not exist -> type"
}

Where:

  • value: Object. The output parameter information of the event.

  • time: Long. The timestamp when the event was generated.

  • code: Integer. The error code for TSL validation failures. Error codes for devices.

  • message: String. The error message returned when data fails TSL model validation, including the failure cause and invalid parameters.

time

Long

The time when the event was reported. Defaults to the time when IoT Platform generates the data if not reported by the device.

Submit device properties in batches

Topic: /${productKey}/${deviceName}/thing/property/batch/post

Reports properties submitted by a device in batches.

Data format:

{
    "productKey": "al12345****",
    "deviceName": "deviceName1234",
    "instanceId": "iot-0***",
    "requestId": "2",
    "items": {
        "Power": [
            {
                "value": "on",
                "time": 1524448722000
            },
            {
                "value": "off",
                "time": 1524448722001
            }
        ],
        "WF": [
            {
                "value": 3,
                "time": 1524448722000
            },
            {
                "value": 4,
                "time": 1524448722009
            }
        ]
    }
}

Parameter descriptions:

Parameter

Type

Description

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

instanceId

String

The ID of the instance to which the device belongs.

requestId

String

The Id from the raw device message. A numeric string in the range 0 to 4294967295. Must be unique per device.

items

Object

The device data.

Power

String

The property identifier. For property names, see the TSL description of the product.

If the property is a custom module property, the property identifier is in the ${ModuleIdentifier}:${PropertyIdentifier} format (a colon : is used as a separator). For example, if the identifier of a custom TSL model module is test, the data format is:

{
    "items":{
        "test:Power":[
            {
                "value":"on",
                "time":1510799670074
            },
            {
                "value": "off", 
                "time": 1524448722001
            }
        ],
        "test:WF":[
            {
                "value": 3, 
                "time": 1524448722000
            },
            {
                "value": 4, 
                "time": 1524448722009
            }
        ]
    }
}

WF

value

Defined by TSL

The property value.

time

Long

The time when the property was reported. Defaults to the time when IoT Platform generates the data if not reported by the device.

Submit device events in batches

Topic: /${productKey}/${deviceName}/thing/event/batch/post

Reports events submitted by a device in batches.

Data format:

{
    "productKey": "al12345****",
    "deviceName": "deviceName1234",
    "instanceId": "iot-0***",
    "requestId": "2",
    "items": {
        "alarmEvent": [
            {
                "value": {
                    "Power": "on",
                    "WF": "2"
                },
                "time": 1524448722000
            },
            {
                "value": {
                    "Power": "on",
                    "WF": "2"
                },
                "time": 1524448723000
            }
        ]
    }
}

Parameter descriptions:

Parameter

Type

Description

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

instanceId

String

The ID of the instance to which the device belongs.

requestId

String

The Id from the raw device message. A numeric string in the range 0 to 4294967295. Must be unique per device.

items

Object

The device data.

alarmEvent

List

The identifier of the event.

value

Object

The parameters of the event.

In the preceding example, Power and WF are the parameter names of the event.

time

Long

The time when the event was reported. Defaults to the time when IoT Platform generates the data if not reported by the device.

Device lifecycle changes

Topic: /${productKey}/${deviceName}/thing/lifecycle

Reports device creation, deletion, enablement, and disablement events.

Data format:

{
    "action": "create|delete|enable|disable",
    "iotId": "4z819VQHk6VSLmmBJfrf00107e****",
    "productKey": "al5eCzh****",
    "deviceName": "5gJtxDVeGAkaEztpisjX",
    "deviceSecret": "wsde***", 
    "messageCreateTime": 1510292739881 
}

Parameter descriptions:

Parameter

Type

Description

action

String

  • create: A device is created.

  • delete: A device is deleted.

  • enable: A device is enabled.

  • disable: A device is disabled.

iotId

String

The unique identifier of the device in IoT Platform.

productKey

String

The unique identifier of the product.

deviceName

String

The name of the device.

deviceSecret

String

The device secret. This parameter is included only if the action parameter is set to create.

messageCreateTime

Integer

The timestamp when the message was generated. Unit: millisecond.

Device topology changes

Topic: /${productKey}/${deviceName}/thing/topo/lifecycle

Reports topology changes between a sub-device and a gateway.

Data format:

{
    "action" : "create|delete|enable|disable",
    "gwIotId": "dfaejVQHk6VSLmmBJfrf00107e****",
    "gwProductKey": "al5eCzh****",
    "gwDeviceName": "deviceName1234",
    "devices": [
        {
            "iotId": "4z819VQHk6VSLmmBJfrf00107e****",
            "productKey": "ala4Czh****",
            "deviceName": "deviceName1234"
        }
    ],
    "messageCreateTime": 1510292739881
}

Parameter descriptions:

Parameter

Type

Description

action

String

  • create: A topological relationship is added.

  • delete: A topological relationship is removed.

  • enable: A topological relationship is enabled.

  • disable: A topological relationship is disabled.

gwIotId

String

The unique identifier of the gateway device in IoT Platform.

gwProductKey

String

The unique identifier of the gateway product.

gwDeviceName

String

The name of the gateway device.

devices

Object

The list of sub-devices that are changed.

iotId

String

The unique identifier of the sub-device in IoT Platform.

productKey

String

The unique identifier of the sub-device product.

deviceName

String

The name of the sub-device.

messageCreateTime

Integer

The timestamp when the message was generated. Unit: millisecond.

Gateway discovers sub-devices

Topic: /${productKey}/${deviceName}/thing/list/found

Reports sub-device information detected by a gateway.

Data format:

{
    "gwIotId":"dfaew9VQHk6VSLmmBJfrf00107e****",
    "gwProductKey":"al12345****",
    "gwDeviceName":"deviceName1234",
    "devices":[
        {
            "iotId":"4z819VQHk6VSLmmBJfrf00107e****",
            "productKey":"alr56g9****",
            "deviceName":"deviceName1234"
        }
    ]
}

Parameter descriptions:

Parameter

Type

Description

gwIotId

String

The unique identifier of the gateway device in IoT Platform.

gwProductKey

String

The unique identifier of the gateway product.

gwDeviceName

String

The name of the gateway device.

devices

Object

The list of discovered sub-devices.

iotId

String

The unique identifier of the sub-device in IoT Platform.

productKey

String

The unique identifier of the product to which the sub-device belongs.

deviceName

String

The name of the sub-device.

Results of downstream commands

Topic: /${productKey}/${deviceName}/thing/downlink/reply/message

Reports results of asynchronous property setting and service invocation commands processed by a device. Also returns error messages for failed commands.

Data format:

{
    "gmtCreate":1510292739881,
    "iotId":"4z819VQHk6VSLmmBJfrf00107e****",
    "productKey":"al12355****",
    "deviceName":"deviceName1234",
    "requestId":"2",
    "code":200,
    "message":"success",
    "topic":"/sys/al12355****/deviceName1234/thing/service/property/set",
    "data":{},
    "checkFailedData":{
        "value": {
            "PicID": "15194139"
        },
        "code":6304,
        "message":"tsl parse: params not exist -> PicID"
    }
}

Parameter descriptions:

Parameter

Type

Description

gmtCreate

Long

The UTC timestamp.

iotId

String

The unique identifier of the device in IoT Platform.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

requestId

String

The Id from the raw device message. A numeric string in the range 0 to 4294967295. Must be unique per device.

code

Integer

The device result code. Values are listed in the Result codes table.

message

String

The result code information that the device returns.

topic

String

The information about the topic that is used to send the command to the device.

data

Object

The result returned by the device. For Alink format data, the device processing result is returned directly. For pass-through format data, the data must be transformed by a script.

checkFailedData

Object

The data that fails the TSL model data validation.

value

Defined by TSL

The property value or service parameter value that fails the TSL model data validation.

In the preceding example, PicID is the name of the parameter that fails the validation.

code

Integer

The error code for TSL validation failures. Error codes for devices.

message

String

The error message returned when data fails TSL model validation, including the failure cause and invalid parameters.

Table 1. Result codes

code

message

Description

200

success

The request is successful.

400

request error

An internal service error occurred during processing.

460

request parameter error

Invalid request parameter. The device failed to validate the input parameter.

429

too many requests

Too many requests.

9200

device not actived

The device is not activated.

9201

device offline

The device is offline.

403

request forbidden

The request is forbidden due to an overdue payment.

Resolve these errors using the Error codes for devices reference.

Submit historical properties

Topic: /${productKey}/${deviceName}/thing/event/property/history/post

Reports historical TSL property data submitted by a device.

Data format:

{
    "iotId":"4z819VQHk6VSLmmBJfrf00107e****",
    "requestId":"2",
    "productKey":"12345****",
    "deviceName":"deviceName1234",
    "gmtCreate":1510799670074,
    "deviceType":"Ammeter",
    "items":{
        "Power":{
            "value":"on",
            "time":1510799670074
        },
        "Position":{
            "time":1510292697470,
            "value":{
                "latitude":39.9,
                "longitude":116.38
            }
        }
    },
    "checkFailedData":{
        "attribute_8":{
            "time": 1510292697470,
            "value": 715665571,
            "code":6304,
            "message":"tsl parse: params not exist -> attribute_8"
        }
    }
}

Parameter descriptions:

Parameter

Type

Description

iotId

String

The unique identifier of the device in IoT Platform.

requestId

String

The Id from the raw device message. A numeric string in the range 0 to 4294967295. Must be unique per device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

gmtCreate

Long

The time when the data forwarding message was generated.

deviceType

String

The category of the device.

Set when creating a product (Create a product or CreateProduct).

items

Object

The device data.

Power

String

The property identifier. For property names, see the TSL description of the product.

If the property is a custom module property, the property identifier is in the ${ModuleIdentifier}:${PropertyIdentifier} format (a colon : is used as a separator). For example, if the identifier of a custom TSL model module is test, the data format is:

{
    "items":{
        "test:Power":{
            "value":"on",
            "time":1510799670074
        },
        "test:Position":{
            "time":1510292697470,
            "value":{
                "latitude":39.9,
                "longitude":116.38
            }
        }
    }
}

Position

attribute_8

checkFailedData

Object

The data that fails the TSL model data validation.

value

Defined by TSL

The property value.

time

Long

The time when the property was reported. Defaults to the time when IoT Platform generates the data if not reported by the device.

code

Integer

The error code for TSL validation failures. Error codes for devices.

message

String

The error message returned when data fails TSL model validation, including the failure cause and invalid parameters.

Submit historical events

Topic: /${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/history/post

Reports historical event data submitted by a device.

Data format:

{
    "identifier":"BrokenInfo",
    "name":"Damage Rate Submission",
    "type":"info",
    "iotId":"4z819VQHk6VSLmmBJfrf00107e***",
    "requestId":"2",
    "productKey":"X5eCzh6***",
    "deviceName":"5gJtxDVeGAkaEztpisjX",
    "value":{
        "Power":"on",
        "Position":{
            "latitude":39.9,
            "longitude":116.38
        }
    },
    "checkFailedData":{},
    "time":1510799670074
}

Parameter descriptions:

Parameter

Type

Description

identifier

String

The identifier of the event.

If the event is a custom module event, the event identifier is in the ${ModuleIdentifier}:${EventIdentifier} format (a colon : is used as a separator). For example, if the identifier of a custom TSL model module is test, the data format is:

"test:identifier":"BrokenInfo",

name

String

The name of the event.

type

String

The event type. For event types, see the TSL description of the product.

iotId

String

The unique identifier of the device in IoT Platform.

requestId

String

The Id from the raw device message. A numeric string in the range 0 to 4294967295. Must be unique per device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

gmtCreate

Long

The time when the data forwarding message was generated.

value

Object

The output parameter information of the event. The example shows information about the two parameters Power and Position.

{
    "Power":"on",
    "Position":{
        "latitude":39.9,
        "longitude":116.38
    }
}
Important
  • Only when all output parameters of the event pass the validation, all output parameters are displayed in the value parameter. In this case, the checkFailedData parameter is empty.

  • If any output parameter of the event fails the validation, all output parameters are displayed in the checkFailedData parameter. In this case, the value parameter is empty.

checkFailedData

Object

The data that fails the TSL model data validation.

If the output parameters of the event fail the validation, the checkFailedData parameter is:

{
    "value":{
        "Power":"on",
        "Position":{
            "latitude":39.9,
            "longitude":116.38
        }
    },
    "time":1524448722000,
    "code":6304,
    "message":"tsl parse: params not exist -> type"
}

Where:

  • value: Object. The output parameter information of the event.

  • time: Long. The timestamp when the event was generated.

  • code: Integer. The error code for TSL validation failures. Error codes for devices.

  • message: String. The error message returned when data fails TSL model validation, including the failure cause and invalid parameters.

time

Long

The time when the event was reported. Defaults to the time when IoT Platform generates the data if not reported by the device.

OTA update status notifications

Topic: /${productKey}/${deviceName}/ota/upgrade

Reports OTA update results (success, failure, or cancellation).

Note

If a device has an unfinished update task and you initiate a batch update, the batch update fails. IoT Platform does not forward the failure message in this case.

Data format:

{
    "iotId": "4z819VQHk6VSLmmBJfrf00107e****",
    "productKey": "X5eCzh6****",
    "deviceName": "deviceName1234",
    "moduleName": "default",
    "status": "SUCCEEDED|FAILED|CANCELED",
    "messageCreateTime": 1571323748000,
    "srcVersion": "1.0.1",
    "destVersion": "1.0.2",
    "desc": "success",
    "jobId": "wahVIzGkCMuAUE2gDERM02****",
    "taskId": "y3tOmCDNgpR8F9jnVEzC01****"
}

Parameter descriptions:

Parameter

Type

Description

iotId

String

The unique identifier of the device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

moduleName

String

The name of the OTA module.

status

String

The update status.

  • SUCCEEDED: The update is successful.

  • FAILED: The update failed.

  • CANCELED: The update is canceled.

messageCreateTime

Long

The timestamp when the message was generated. Unit: millisecond.

srcVersion

String

The version before the update.

destVersion

String

The destination version of the update.

desc

String

The description of the update status.

jobId

String

The update batch ID. Uniquely identifies the update batch.

taskId

String

The unique identifier of the device update record.

OTA update progress notifications

Topic: /${productKey}/${deviceName}/ota/progress/post

Reports OTA update progress.

Data format:

{
    "iotId": "4z819VQHk6VSLmmBJfrf00107e****",
    "productKey": "X5eCzh6****",
    "deviceName": "deviceName1234",
    "moduleName":"default",
    "status":"IN_PROGRESS",
    "step": "90",
    "messageCreateTime": 1571323748000,
    "srcVersion":"1.0.1",
    "destVersion":"1.0.2",
    "desc": "success",
    "jobId": "wahVIzGkCMuAUE2gDERM02****",
    "taskId": "y3tOmCDNgpR8F9jnVEzC01****"
}

Parameter descriptions:

Parameter

Type

Description

iotId

String

The unique identifier of the device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

moduleName

String

The name of the OTA module.

status

String

The update status. The value is fixed to IN_PROGRESS (in progress).

step

Integer

The update progress reported by the device.

messageCreateTime

Long

The timestamp when the message was generated. Unit: millisecond.

srcVersion

String

The version before the update.

destVersion

String

The destination version of the update.

desc

String

The description of the update status.

jobId

String

The update batch ID. Uniquely identifies the update batch.

taskId

String

The unique identifier of the device update record.

OTA module version change notifications

Topic: /${productKey}/${deviceName}/ota/version/post

Reports OTA module version numbers when a device submits a new version.

Data format:

{
    "iotId": "4z819VQHk6VSLmmBJfrf00107e****",
    "deviceName": "deviceName1234",
    "productKey": "X5eCzh6****",
    "moduleName": "BarcodeScanner",
    "moduleVersion": "1.0.3",
    "messageCreateTime": 1571323748000
}

Parameter descriptions:

Parameter

Type

Description

iotId

String

The unique identifier of the device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

moduleName

String

The name of the module.

moduleVersion

String

The version number of the module.

messageCreateTime

Long

The timestamp when the message was generated. Unit: millisecond.

OTA update batch status notifications

Topic: /${productKey}/${packageId}/${jobId}/ota/job/status

Reports OTA update batch status changes.

Data format:

{
    "productKey": "X5eCzh6****",
    "moduleName": "BarcodeScanner",
    "packageId": "wahVIzGkCMuAUE2***",
    "jobId": "wahVIzGkCMuAUE2gDERM02****",
    "state": "IN_PROGRESS",
    "messageCreateTime": 1571323748000
}

Parameter descriptions:

Parameter

Type

Description

productKey

String

The unique identifier of the product to which the device belongs.

moduleName

String

The name of the module.

packageId

String

The ID of the update package. The value of this parameter is the same as the value of the FirmwareId parameter that is returned when you call the CreateOTAFirmware operation to create an update package.

jobId

String

The update batch ID. Uniquely identifies the update batch.

state

String

The status of the update batch. Valid values:

  • PLANNED: The update is not started.

  • IN_PROGRESS: The update is in progress.

  • COMPLETED: The update is complete.

  • CANCELED: The task has been canceled.

  • UNFINISH: Unfinished.

    If an Enterprise instance has an insufficient number of available upgrades, the status of the update batch is UNFINISH.

messageCreateTime

Long

The timestamp when the message was generated. Unit: millisecond.

Device tag changes

Topic: /${productKey}/${deviceName}/thing/deviceinfo/update

Reports device tag changes.

Data format:

{
    "action": "UPDATE|DELETE|DELETEALL"
    "iotId": "4z819VQHk6VSLmmBJfrf00107e****",
    "productKey": "X5eCzh6****",
    "deviceName": "deviceName1234",
    "deletedAttrKeyList": ["abc", "def", "rng"],
    "value": [
        {
            "attrKey": "tagKey",
            "attrValue": "tagValue"
        }
    ],
    "messageCreateTime": 1510799670074
}

Parameter descriptions:

Parameter

Type

Description

action

String

The type of tag change. Valid values:

  • UPDATE: A tag is updated or added.

  • DELETE: A specified tag is deleted.

  • DELETEALL: All tags are cleared.

iotId

String

The unique identifier of the device.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

deletedAttrKeyList

List

The list of keys of the deleted tags.

This parameter is displayed only when the action parameter is set to DELETE.

value

List

The tag data.

attrKey

String

The tag key.

attrValue

String

The tag value.

messageCreateTime

Long

The timestamp when the message was generated. Unit: millisecond.

Device job status notifications

Topic: /sys/uid/${uid}/job/${jobId}/lifecycle

Reports status changes for device jobs, including batch property setting, batch service invocation, and custom jobs.

In the topic, ${uid} is your Alibaba Cloud account ID. To view the ID, log on to the IoT Platform console, click your profile picture, and navigate to the Security Settings page.

Data format:

{
    "jobId": "4z819VQHk6VSLmm***ee200",
    "jobType": "CUSTOM_JOB",
    "status": "INITIALIZING",
    "messageCreateTime": 1510292739881
}

Parameter descriptions:

Parameter

Type

Description

jobId

String

The job ID. Globally unique identifier of the job.

jobType

String

The job type.

  • SET_PROPERTY: a job to set device properties in a batch.

  • INVOKE_SERVICE: a job to invoke a device service in a batch.

  • CUSTOM_JOB: a custom job.

status

String

The job status. Valid values:

  • INITIALIZING: The job is being initialized.

  • WAITING: The job is waiting for scheduling.

  • IN_PROGRESS: The job is in progress.

  • COMPLETED: The job is complete.

  • CANCELLING: The job is being canceled.

  • CANCELLED: Cancelled.

  • REMOVING: The job is being deleted.

messageCreateTime

Long

The timestamp when the message was generated. Unit: millisecond.

Instance migration job status notifications

Topic: /sys/uid/{uid}/distribution/{jobId}/lifecycle

Reports status changes for instance migration jobs.

In the topic, ${uid} is your Alibaba Cloud account ID. To find your account ID, log on to the IoT Platform console, move the mouse pointer over your profile picture, and view the Account ID.

Data format:

{
    "jobId": "4z819VQHk6VSLmmxxxxxxxxxxee200",
    "status": "GRAY_EXECUTING",
    "messageCreateTime": 1510292739881,
    "type":"INSTANCE_UPGRADE",
    "sourceInstance":"iotx-oxssharez200",
    "targetInstance":"iot-es5v4***",
    "successDevices":[
        {
            "productKey":"al12***",
            "deviceName":"deviceName1",
            "iotId":"4z81frf00107e***"
        }
    ]
}

Parameter descriptions:

Parameter

Type

Description

jobId

String

The job ID. Globally unique identifier of the job.

status

String

The job status. Valid values:

  • GRAY_EXECUTING: Grayscale migration in progress.

  • GRAY_FINISHED: Grayscale migration complete.

  • ALL_EXECUTING: Full migration in progress.

  • ALL_FINISHED: Full migration complete.

  • ALL_PAUSE: Migration paused.

  • ROLL_BACK_EXECUTING: Rollback in progress.

  • BATCH_ROLL_BACK_EXECUTING: Batch rollback in progress.

  • ROLL_BACK_PAUSE: Rollback paused.

messageCreateTime

Long

The timestamp when the message was generated. Unit: millisecond.

type

String

The job type. The value is fixed to INSTANCE_UPGRADE.

sourceInstance

String

The ID of the source public instance for the instance migration. The ID of an earlier-version public instance is iotx-oxssharez200.

Instance details are covered in Overview of instances.

targetInstance

String

The ID of the target Enterprise instance for the instance migration.

successDevices

List

Information about the devices that are successfully migrated:

  • When the status is GRAY_EXECUTING or ALL_EXECUTING, this parameter indicates the devices that are successfully migrated from the source public instance to the target Enterprise instance.

  • When the status is ROLL_BACK_EXECUTING or BATCH_ROLL_BACK_EXECUTING, this parameter indicates the devices that are successfully migrated from the Enterprise instance back to the public instance.

The successDevices parameter may be empty during the migration process. This indicates that the job status has changed and the job has started, but no devices have been migrated yet.

productKey

String

The unique identifier of the product to which the device belongs.

deviceName

String

The name of the device.

iotId

String

The unique identifier of the device in IoT Platform.