to get all variable names/types and functions, but is there a URL for getting the values of all the variables too?
i’d rather a single request that returns name/values pairs i can iterate through to make an array/hash, rather than a bunch of urls to parse individually.
I don’t think there’s a method that will let you do that. However, it’s definitely not a bad idea. Maybe @Dave and @zachary can comment more on it and add it to the backlog?
how odd. this was my first time at using the api functions and “how do i get name/value pairs?” was the first thing i thought of, surely people aren’t calling 2 url’s just to get temperature and pressure from barometric sensors?
hey i just halved (at least) the load on your servers!
Interesting interesting… good thought @sej7278. The important difference between those two calls is that the list of variable names exposed by a Core is cached in the Cloud, so GET /v1/devices/:id can list them without actually hitting the Core. However, getting the value of a variable obviously does require communication with the device.
On the other hand, the encrypted CoAP communication is miniscule in comparison to the HTTPS request on the API side, so adding some way to do this in a single API request is a good idea. I’ve added it to our backlog. Thanks for the suggestion!
Returns variables and values, rather than variables and data types. If you have 20 variables on a page, you really don’t want to do 20 requests as your app will be so slooooowwww…
Sorry to gravedig this thread, but I’m also looking for an update on this. I’d like to gather multiple variables for ingestion into InfluxDB and being able to get them all in a single request as native data values (i.e. not encoded into a string) would be very helpful.
No changes here yet, but I’ll bump it again in our backlog. We have a lot to accomplish, and without more community validation, I don’t expect this will get built anytime soon. Keep letting us know your needs and desires though. The more suggestions from the community the better!
Spent half a day today, only to realise it wasn’t my code throwing errors… but the API providing data types not values… sigh. Wish I had read this first
The system we are building is going to read a range of values from multiple sensors, sometimes we will not know which sensors are active on the device. It’s a bit of a pain to have our servers running repeated requests for sensors that may not be connected to the device.
Plus the coding overhead to do multiple calls and maintain them as we develop is tedious.