HTTP GET request to Tago Core API with advanced parameters

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”

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.

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 :wink:

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 :wink: