2015-07-20 20:06:30 +00:00
|
|
|
Data Source Results Format
|
|
|
|
==========================
|
|
|
|
|
2016-04-15 20:26:21 +00:00
|
|
|
All data sources in Re:dash return the following results in JSON format:
|
2015-07-20 20:06:30 +00:00
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
|
|
|
{
|
|
|
|
"columns" : [
|
|
|
|
{
|
2016-07-11 13:19:55 +00:00
|
|
|
"name" : "COLUMN_NAME", // Required: a unique identifier of the column name in this result
|
|
|
|
|
|
|
|
"friendly_name" : "FRIENDLY_NAME", // Required: friendly name of the column. Currently unused, so can be the same as _name_.
|
|
|
|
"type" : "VALUE_TYPE" // // Supported types: integer, float, boolean, string (default), datetime (ISO-8601 text format). If unknown, use "string".
|
2015-07-20 20:06:30 +00:00
|
|
|
},
|
|
|
|
...
|
|
|
|
],
|
|
|
|
"rows" : [
|
|
|
|
{
|
2015-10-13 04:25:11 +00:00
|
|
|
// name is the column name as it appears in the columns above.
|
2016-07-11 13:19:55 +00:00
|
|
|
// VALUE is a valid JSON value. For dates it's an ISO-8601 string.
|
2015-07-20 20:06:30 +00:00
|
|
|
"name" : VALUE,
|
|
|
|
"name2" : VALUE2
|
|
|
|
},
|
|
|
|
...
|
2015-10-13 04:25:11 +00:00
|
|
|
]
|
2015-07-20 20:06:30 +00:00
|
|
|
}
|
2016-07-11 13:19:55 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
|
|
|
{
|
|
|
|
"columns": [
|
|
|
|
{
|
|
|
|
"name": "date",
|
|
|
|
"type": "date",
|
|
|
|
"friendly_name": "date"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "day_number",
|
|
|
|
"type": "integer",
|
|
|
|
"friendly_name": "day_number"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "value",
|
|
|
|
"type": "integer",
|
|
|
|
"friendly_name": "value"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "total",
|
|
|
|
"type": "integer",
|
|
|
|
"friendly_name": "total"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"rows": [
|
|
|
|
{
|
|
|
|
"value": 40832,
|
|
|
|
"total": 53141,
|
|
|
|
"day_number": 0,
|
|
|
|
"date": "2014-01-30"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"value": 27296,
|
|
|
|
"total": 53141,
|
|
|
|
"day_number": 1,
|
|
|
|
"date": "2014-01-30"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"value": 22982,
|
|
|
|
"total": 53141,
|
|
|
|
"day_number": 2,
|
|
|
|
"date": "2014-01-30"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
|