When making a request to the TagoIO API, you must also specify the appropriate regional endpoint. Check out the available regions here: API documentation (link included in the original article).
Include your device token in the Authorization header.
Authorization: Your-Device-Token
Use the regional data endpoint:
GET https://api.<region>.tago.io/data
The following querystring parameters are supported:
Below is a sample response when no query parameters are supplied:
{
"status": true,
"result": [
{
"id": "547e42847dbf3af122c02582",
"location": {
"coordinates": [41.878876, -87.635915],
"type": "Point"
},
"time": "2014-12-02T22:51:48.005Z",
"variable": "location"
},
{
"id": "547e353d7dbf3af122c0257d",
"time": "2014-12-02T21:55:09.301Z",
"unit": "%",
"value": 32,
"variable": "fuel_level"
},
{
"id": "547e41f97dbf3af122c02580",
"time": "2014-12-02T22:49:29.777Z",
"unit": "psi",
"value": 25,
"variable": "oil_pressure"
}
]
}
The variable parameter specifies which variable(s) to return.
Example for a single variable:
https://api.<region>.tago.io/data?variable=temperature
To request multiple variables, use an array syntax:
https://api.<region>.tago.io/data?variable[]=temperature&variable[]=pressure
The query parameter triggers predefined functions. Only one query can be used per request.
_time_._value_ field._location_ field.Example:
https://api.<region>.tago.io/data?variable=temperature&query=last_item
The qty parameter limits how many results are returned (default 15).
Example to retrieve 99 records:
https://api.<region>.tago.io/data?variable=temperature&qty=99
Use start_date and end_date to filter data between two timestamps. They accept various formats, including relative time expressions.
Example:
https://api.<region>.tago.io/data?variable=temperature&start_date=2014-12-25&end_date=2014-12-26
If the interval contains more than 15 items, add qty to increase the limit.
Relative dates are calculated from the current time.
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.