attribute.publish

The attribute.publish command is used to publish and set an attribute for a thing.

TR50 Request


                        {
  "cmd": {
    "command": "attribute.publish",
    "params": {
      "thingKey": "mything",
      "key": "boardid",
      "value": "102",
      "ts": "2016-10-20T02:03:04.322Z",
      "republish": false
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

 

Thing Identifier Parameters

Yes

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

Yes

The key for the attribute that you wish to set.

value

String

Yes

The value of the attribute. Pass null as the value to unset the attribute.

ts

String

 

The timestamp at which the value was recorded. 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.

corrId

String

A correlation ID is 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
  }
}