attribute.current

The attribute.current command is used to retrieve the current value of a attribute.

TR50 Request


                        {
  "1": {
    "command": "attribute.current",
    "params": {
      "thingKey": "mything",
      "key": "myattr",
      "ts": "2015-04-01T12:00:00Z"
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

 

Thing Identifier Parameters

 

Identifies the thing to which the attribute data is 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 retrieve.

ts

Timestamp

 

If specified, attribute.current will return the value at or immediately preceding the specified timestamp.

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 and the attribute value is returned. Otherwise, an error and error message will be returned.


                        {
  "1": {
    "success": true,
    "params": {
      "value": "my value",
      "ts": "2014-11-17T20:41:45Z"
    }
  }
}
      

In the event that no attributes have been published, and the assigned thing definition contains a default value for the attribute, only the value field will be returned.


                        {
  "1": {
    "success": true,
    "params": {
      "value": "default value"
    }
  }
}
      

Response Parameters

Name

Type

Description

value

String

The current value for the requested attribute. Or, if defined in the thing definition, the default value.

ts

String

Timestamp for the given attribute. Not present if the default value is returned.

corrID

String

The correlation identifier associated with the attribute.