A device can send data to TagoIO by using the POST method.
POST https://api.tago.io/data
KEY | TYPE | REQUIRED |
---|---|---|
variable | string [max 100 characters] | yes |
unit | string [max 25 characters] | no |
value | string/number/boolean [max 6kB] | no |
time | string | no |
group | string [max 100 characters] | no / auto |
location | object || geoJSON | no |
metadata | object [max 10kB] | no |
You will need to include a Device-Token to authorize the operation. Learn more about the fields necessary to send data to TagoIO, including the Header and other formats.
Variable should NOT contain special characters such as *?!<>.-=$ or space.
Variables will always be converted to lowercase.
{ "variable": "temperature", "unit" : "F", "value" : 55, "time" : "2015-11-03 13:44:33", "location": {"lat": 42.2974279, "lng": -85.628292} }
Try our Device Emulator to post data and learn the JSON structure.
It’s possible to send more than one register at the same time, using an array. In the example below, the device is sending two registers together.
[{ "variable": "temperature", "unit" : "F", "value" : 55 }, { "variable": "temperature_celsius", "unit" : "C", "value" : 12 }]
The limit of each individual Post is 200 kB (that is about 8,000 registers).
TagoIO uses metadata on variables to change some properties in widgets, but you can also use it to store more information on your variables.
Example of a variable with metadata
{ "variable": "temperature", "unit": "F", "value": 55, "metadata": { "color": "red" } }
If you send this example and display it in a table, the row containing that value will be red.
Example of a variable with location and metadata
{ "variable": "temperature", "unit": "F", "value": 55, "metadata": { "color": "red", "icon": "car" }, "location": {"lat": 42.2974279, "lng": -85.628292} }
If you add this example to a table, the row containing that value will be red, but the icon will be ignored. But if you add it to a Map, the pin containing that location will be red, and its icon will be a car. Learn more about Infobox on Map Widget.