Some information about a device, such as the vendor and device model, can be reported to IoT Platform as device tags.

Report tags

The following topics are used when a device sends requests to IoT Platform and IoT Platform sends responses to the device:

  • Request topic: /sys/{productKey}/{deviceName}/thing/deviceinfo/update
  • Response topic: /sys/{productKey}/{deviceName}/thing/deviceinfo/update_reply

Sample request in the Alink JSON format:

{
  "id": "123",
  "version": "1.0",
  "sys":{
      "ack":0
  },
  "params": [
    {
      "attrKey": "Temperature",
      "attrValue": "36.8"
    }
  ],
  "method": "thing.deviceinfo.update"
}

Sample response in the Alink JSON format:

{
  "id": "123",
  "code": 200,
  "data": {}
}

The following table describes the parameters.

Parameter Type Description
id String The ID of the message. Valid values: 0 to 4294967295. Each message ID must be unique for the device.
version String The version of the protocol. Valid value: 1.0.
sys Object The parameter for extended features. The value contains the fields for each feature.
Note If no extended features are configured when you use a device SDK to develop device features, this parameter is unavailable. The extended features use the default configurations.
ack Integer The extended feature field in the sys parameter. This field specifies whether IoT Platform needs to return response data for the registration request. Valid values:
  • 1: indicates that IoT Platform needs to return response data.
  • 0: indicates that IoT Platform does not need to return response data.
Note

If this feature is not configured, this parameter is unavailable. By default, IoT Platform returns response data for a registration request.

params Object

The request parameters, which include the attrKey key and attrValue value of the tag.

The params parameter can contain up to 200 elements in an array.

method String The request method. Valid value: thing.deviceinfo.update.
attrKey String The key of the tag. The key can contain letters, digits, underscores (_), hyphens (-), number signs (#), at signs (@), percent signs (%), ampersands (&), asterisks (*), and periods (.). It can be up to 30 characters in length.
attrValue String The value of the tag. The value can contain Chinese characters, letters, digits, Japanese characters, underscores (_), hyphens (-), number signs (#), at signs (@), percent signs (%), ampersands (&), colons (:), and periods (.). It can be up to 128 characters in length. One Chinese or Japanese character is 2 characters in length.
code Integer The HTTP status code in the response. A value of 200 indicates that the request was successful.

The following table describes the error codes.

HTTP status code Error message Description
460 request parameter error The error message returned because one or more request parameters are invalid.
6100 device not found The error message returned because the specified device does not exist.

Delete tags

The following topics are used when a device sends requests to IoT Platform and IoT Platform sends responses to the device:

  • Request topic: /sys/{productKey}/{deviceName}/thing/deviceinfo/delete
  • Response topic: /sys/{productKey}/{deviceName}/thing/deviceinfo/delete_reply

Sample request in the Alink JSON format:

{
  "id": "123",
  "version": "1.0",
  "sys":{
      "ack":0
  },
  "params": [
    {
      "attrKey": "Temperature"
    }
  ],
  "method": "thing.deviceinfo.delete"
}

Sample response in the Alink JSON format:

{
  "id": "123",
  "code": 200,
  "data": {}
}

The following table describes the parameters.

Parameter Type Description
id String The ID of the message. Valid values: 0 to 4294967295. Each message ID must be unique for the device.
version String The version of the protocol. Valid value: 1.0.
sys Object The parameter for extended features. The value contains the fields for each feature.
Note If no extended features are configured when you use a device SDK to develop device features, this parameter is unavailable. The extended features use the default configurations.
ack Integer The extended feature field in the sys parameter. This field specifies whether IoT Platform needs to return response data for the registration request. Valid values:
  • 1: indicates that IoT Platform needs to return response data.
  • 0: indicates that IoT Platform does not need to return response data.
Note

If this feature is not configured, this parameter is unavailable. By default, IoT Platform returns response data for a registration request.

params Object The request parameters, which include the attrKey key of the tag to be deleted.
method String The request method. Valid value: thing.deviceinfo.delete.
attrKey String The key of the tag to be deleted.
code Integer The HTTP status code in the response. A value of 200 indicates that the request was successful.

The following table describes the error codes.

HTTP status code Error message Description
460 request parameter error The error message returned because one or more request parameters are invalid.
6100 device not found The error message returned because the specified device does not exist.