sosnus15
(sosnus15)
March 14, 2024, 3:47pm
1
Hi!
I send request:
curl --location 'http://192.168.0.195:40083/data?variables=myvar&query=last_item' \
--header 'device-token: 953a6fa8-ac1b-456f-XXXX-11b32211a871'
And in output I see:
{"status":true,"result":[{"id":"710a50f15b0740cbe03565ef","device":"710a20c6b8f8efaa06a51bce","group":"c6b5104b1d28af9252d4a017","time":"2024-03-14T15:03:29.317Z","value":"user01","variable":"myvar"}]}
Is any API parameter to hide parameters like id or group? I need only “value” field, eventually “time” and “variable”
stoklosa
(Ricardo Stoklosa)
March 20, 2024, 7:41pm
2
Hi Sosnus15,
Currently, there isn’t a direct API parameter available to selectively hide or filter specific fields like “id” or “group” in the response. You might consider processing the response on the client side to extract only the necessary information.
sosnus15
(sosnus15)
March 25, 2024, 6:05pm
3
Finally I found sollution for client side. Using console and curl You can do it using “jq” for example:
curl --location 'http://192.168.0.195:40083/data?variables=myvar&query=last_item' \
--header 'device-token: 953a6fa8-ac1b-456f-XXXX-11b32211a871' | jq -r '.result[0].value
But I hope, in the future it will be possible to do it directly from tago.io API
sosnus15
(sosnus15)
March 25, 2024, 6:26pm
4
Finally I found sollution for client side. Using console and curl You can do it using “jq” for example:
curl --location 'http://192.168.0.195:40083/data?variables=myvar&query=last_item' \
--header 'device-token: 953a6fa8-ac1b-456f-XXXX-11b32211a871' | jq -r '.result[0].value
But I hope, in the future it will be possible to do it directly from tago.io API