attribute.batch
The attribute.batch command is used to publish batch attribute data.
Publishes are executed sequentially. If any of the individual data publishes fail with an error, the error will be immediately returned and sequential publishing terminates without completion.
TR50 Request
{
"cmd": {
"command": "attribute.batch",
"params": {
"thingKey": "mything",
"key": "myattribute1",
"ts": "2016-04-05T02:03:04.322Z",
"republish": false,
"data": [
{
"value": "The attribute value"
},
{
"key": "myattribute2",
"value": "Another attribute value",
"ts": "2016-04-06T04:05:06.789Z"
}
]
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
|
Thing Identifier Parameters |
Yes |
Identifies the thing to which the attribute data is to be associated. If omitted, the thingKey associated with your session will be used. See Thing Identifier Parameters table below for supported parameters. |
key |
String |
|
Attribute key to use for all data records that do not specify a "key" parameter. |
ts |
String |
|
Timestamp to use for all data records that do not specify a "ts" parameter. Can be overridden for individual publish objects. Defaults to the current time if not specified. |
value |
String |
Yes |
The attribute value to publish. |
republish |
Boolean |
|
By default, if the published value is the same as the current value, a new record will not be added. Set to true to force the record of the value to be added. If not set, the default value is false. |
data |
Array |
|
Array of publish objects. |
corrID |
String |
A correlation ID that can be used when querying to find related data objects. |
Thing Identifier Parameters
Name |
Type |
Description |
---|---|---|
thingKey |
String |
Key of the thing |
thingId |
String |
Id of the thing |
esn |
String |
Esn of the thing |
iccid |
String |
Iccid of the thing |
imei |
String |
Imei of the thing |
imsi |
String |
Imsi of the thing |
meid |
String |
Meid of the thing |
msisdn |
String |
Msisdn of the thing |
TR50 Response
If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true
}
}