How to retrieve data using attribute_read



I tried to read the value of LED(attribute#1024) with the below cloud API.


But the response was something as below. no “data” available.


Could someone provide me with some sample script?



I’m able to retrieve the attribute value through the API /v1/devices/{deviceId}/attributes just fine.

Let me see if I can find a way to get the same values from /v1/accounts/{accountId}/devices/{deviceId}/actions as well, I will follow up here shortly with an answer.




Hi Joe,

Could you tell me how to use /v1/devices/{deviceId}/attributes?

I don’t mind using this new API as long as I can read / write attributes.




This is actually a pretty straightforward API. It’s similar to /v1/accounts/{accountID}/devices?expansions=attributes in the developer doc but a little simpler to use. Why it’s not in the developer doc, I don’t know, I’ll work on having it added.

Basically you can get your list of deviceIDs through /v1/accounts/{accountID}/devices and then perform individual attribute actions on a specific device with:

GET /v1/devices/{deviceID}/attributes to get a list of all the of the device’s attributes and values, or
GET /v1/devices/{deviceID}/attributes/{attributeID} to get the value of a specific attribute (some standard ones are defined at, otherwise for MCU attached devices use the attribute numbers defined in device-description.h in your profile)

You can set a specific attribute with

POST /v1/devices/{deviceID}/attribtues/{attributeID} with the JSON data:

“data”: “”,
“value”: “”

“data” and “value” are related information - I think you only may need to specify one of them. I thought there was a post about this on the developer forum already but I’m not finding it right now. “data” is a little-endian hex representation of the atttribute contents, “value” is the more human-readable version of the same contents (for example “data=0100” and “value=1” would both set the attribute to “1”, and so on).

It’s difficult to explain but your attribute data should be pretty obvious to you if you read it from this API, and modify or set it accordingly.

If I can find the other forum post on the discussion about it, I’ll link it here.




Hi Joe,

I tried the following API.

And the server returned the following response. The entire message was over 10,000 characters long so I’ll post just the beginning of it.
{“timestamp”:1489938189921,“status”:500,“error”:“Internal Server Error”,“exception”:“com.kibanlabs.shared.exception.InternalErrorException”,“message”:“Device is not virtual”, …



Hi Wataru,

My apologies! I gave you the wrong API to use. I’m sorry! :slight_smile: That one worked for me but it apparently is an old one.

The proper API is close to the one you were using before, it’s:


(instead of “/actions” use “?expansions=attributes”)

This one is also documented in the developer documentation at as well.

That one should work better for you. :smile:




Hi Joe,

Thanks. The below command worked well.