Sending Data

Sending Data

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

POST https://api.tago.io/data
KEYTYPEREQUIRED
variablestring [max 100 characters]yes
unitstring [max 25 characters]no
valuestring/number/boolean [max 6kB] no
timestringno
groupstring [max 100 characters]no / auto
locationobject || geoJSONno
metadataobject [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).

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.

When executing requests to TagoIO, you will have a limit on the number of requests that can be made during a certain time period. Read more about our Rate Limits.


    • 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 ...
    • MQTT - Process data, Publish it and Subscribe to a topic

      In this tutorial, you will learn how to process data, publish to a topic, and subscribe to it. We will be using the MQTTX client throughout this tutorial. Connecting to TagoIO MQTT Broker To publish a topic via TagoIO's MQTT, you must first add a ...
    • Data Export

      At TagoIO, you have multiple options for exporting data. You can export device data directly from the Admin panel on your device's page, through the API, or directly from Widgets in either the Admin panel or the TagoRun portal. Exporting data will ...
    • 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 ...