Reporting Attribute Information¶
The third-party system reports the historical attribute data and EnOS will update the corresponding attribute information as per the reported data.
Upstream
Request TOPIC:
sys/${productKey}/integration/attributes/post
Response TOPIC:
sys/${productKey}/integration/attributes/post_reply
Sample Request Format¶
{
"id":"123",
"version":"1.0",
"params":[
{
"deviceKey":"device1",
"attributes":{
"attr1":{
"key1":"val1",
"key2":"val2",
}
}
},
{
"deviceKey":"device2",
"attributes":{
"attr2":2.3
}
}
],
"method":"integration.attribute.post"
}
Sample Response Format¶
{
"id": "123",
"code": 200,
"data": {}
}
Request Parameter Description¶
Parameters |
Type |
Mandatory/Optional |
Description |
---|---|---|---|
id |
Long |
Optional |
The message ID. It is a reserved parameter that is reserved for future use. |
version |
String |
Mandatory |
The version of the protocol. The current version is 1.0. |
params |
Array |
Mandatory |
The parameters required for reporting the attributes. |
attributes |
Struct |
Optional |
The list of the identifiers for the attributes to be reported. At most 200 attributes are allowed to be reported at a time. If this parameter is not specified, no attribute will be reported. |
attr1 |
Struct |
Mandatory |
The identifier of the attribute that you want to report. In this example, the attribute has the identifier attr1. The value you set for the attribute must match the data type defined for this parameter. In this case, the data type for attr1 is struct, defined with 2 paramters key1 and key2. |
key1 |
String |
Mandatory |
The parameter name of the struct data type of the attribute attr1. |
key2 |
String |
Mandatory |
The parameter name of the struct data type of the attribute attr1. |
method |
String |
Mandatory |
The request method. |
Response Parameter Description¶
Parameter |
Type |
Mandatory/Optional |
Description |
---|---|---|---|
code |
Integer |
Mandatory |
The return code. “200” indicates that the request operation is executed successfully. |
data |
JSON |
Mandatory |
The detailed returned information in JSON format. |
Return Code¶
Return Code |
Error Message |
Explanation |
---|---|---|
1204 |
Model validate failed |
|
1257 |
Device not found |
The device does not exist. |