property.batch

The property.batch command is used to publish batch property data.

 For more information about properties see Defining Properties.

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": "property.batch",
    "params": {
      "thingKey": "mything",
      "key": "myp",
      "ts" : "2014-04-05T02:03:04.322Z",
      "corrId": "mycorrid",
      "aggregate":true,
      "data": [
        {
          "key": "myprop",
          "value": 123.44,
          "ts": "2014-04-05T02:03:04.322Z",
          "corrId": "mycorrid"
        },
        {
          "key": "myprop2",
          "value": 42.12,
          "ts": "2014-04-05T02:03:04.322Z",
          "corrId": "mycorrid"
        }
      ]
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

 

Thing Identifier Parameters

 

Identifies the thing to which the property 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

 

Property 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.

corrid

String

 

Correlation ID to use for all data records that do not specify a "corrId" parameter.

aggregate

Boolean

 

If 'true', then aggregate data (hourly and daily) will be generated for the values published in this API call, if 'false' only the history will be saved. If not set, then the Calculate aggregates parameter in the property definition in the thing definition for the thing is used.

data

Array

 

Array of publish 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

Request Publish Object

Name

Type

Required

Description

key

String

Yes

The key for the property that you wish to publish.

value

Integer

 

The value to publish. Defaults to 0.

ts

String

 

The timestamp at which the value was recorded. Defaults to the top level "ts" parameter, if not specified, then the current timestamp will be used.

corrId

String

 

A correlation ID that can be used when querying to find related data objects.

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
  }
}