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",
      "republish": false,
      "data": [
        {
  	   "key": "myattribute1",
	   "value": "my attribute1 value",
	   "ts": "2019-12-06T04:05:06.789Z"
        },
        {
          "key": "myattribute2",
          "value": "my attribute2 value",
          "ts": "2019-12-06T04:05:06.789Z"
        }
      ]
    }
  }
}

Request Parameters

Name Type Required Description
thingKey String Yes* The thing key.
thingid String Id of the thing
esn String ESN of the connection.
iccid String ICCID of the connection.
imei String IMEI of the connection.
imsi String IMSI of the connection.
meid String MEID of the connection.
msisdn String MSISDN of the connection.
*One of the above parameters is required to identify the connection.
key String Attribute key to use for all data records that do not specify a "key" parameter.
value String   The attribute value to publish.
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.
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.

If the correlation ID is different from the one that is published then a new record is added.

If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.

TR50 Response
{
  "cmd": {
    "success": true
  }
}