Hi @Herner, I’m glad you worked this out, and @BDub thanks for the awesome support.
It might be worth noting that Ubidots can also return the last value of a variable. To do this, just make your GET request to this URL (same as before but omitting the “/values” at the end):
request.path = "/api/v1.6/variables/"VARIABLE_ID_SWITCH"/";
It will return general information about the Variable, like name, units, etc., as well as the last value.
Another alternative is to use the pagination feature of the Ubidots API, setting a page size of just 1 value:
request.path = "/api/v1.6/variables/"VARIABLE_ID_SWITCH"/values?page_size=1";
Good luck!