Sending Data

Sending Data

A device can send data to Tago by using the POST method.

POST https://api.tago.io/data
KEYTYPEREQUIRED
variablestring *yes
unitstringno
valuestring/number/booleanno
timestringno
seriestringno
locationobject||locationno
metadataobjectno

Learn how to access TagoIO also using Static IP.

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 10,000 registers or a file size of 200 Kbytes.

Metadata

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.


    • Related Articles

    • Sending Data to Device

      TagoIO supports two-way communication with all your devices so that it can send and receive data. There are some options for you to send data from your application to the device. Among the methods, you can use: Publish to MQTT Post data to a ...
    • Deleting Data

      DEL - https://api.tago.io/data Headers: Authorization: Your device token. Optional Query Strings KEY TYPE DESCRIPTION query string pre-defined by Tago qty string Maximum number of data to be returned start_date string Start date end_date string end ...
    • Getting Data

      HEADERS: Authorization: Your-Device-Token GET - https://api.tago.io/data QUERYSTRINGS: KEY TYPE DESCRIPTION variable string || array Get variables query string pre-defined by Tago qty string Maximum number of data to be returned.  start_date string ...
    • Data Export

      You can download data from your buckets using one of the available formats. Go to the list of Buckets, and click on the 'Export Data' icon located on the top right. Select the format of the file you want to download: CSV XLS JSON XML You can select ...
    • Data Storage

      Data storage is related to the variables stored in the data buckets that are fed by the devices. Each register is composed of a variable and all metadata associated with it. The data storage limit will define the maximum storage capacity for the ...
    Additional Links

       Check the System Status


        Future and past Webinars