thing.attr.get
The thing.attr.get command is used to get an attribute for a thing.
TR50 Request
{
"cmd": {
"command": "thing.attr.get",
"params": {
"thingKey": "mything",
"key": "boardid"
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
thingId |
String |
|
Identifies the thing by id to which the attribute is to be associated. Note:
If a thing identifier is not provided, the thingKey associated with your session will be used. |
thingKey |
String |
|
Identifies the thing by key to which the attribute is to be associated. |
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. |
key |
String |
Yes |
The key for the attribute that you want to get. |
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,
"params": {
"value": "test_attribute",
"ts": "2014-11-10T11:22:33Z"
}
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
value |
String |
The current value for the requested attribute. If the attribute value has not been set by the thing and there is a default attribute set for the thing's thing definition, the default attribute is returned. |
ts |
String |
The timestamp that the value was explicitly set on the thing. There is no timestamp returned when the value returned is the default attribute value. |