Date format
All JavaScript supported formats are supported
- ISO Date
2018-04-23T10:26:00.996Z
- Short Date
04/23/2018
04/23/2018 12:26:00.996+02:00
- Long Date
Mar 23 2018 10:26:00.996Z
23 Mar 2018 12:26:00.996+02:00
March 23 2018
Data format
To forward devices data, two standard Databoom formats are mainly used:
- Forwarding signals with their values. All the values refer to the same date, if it is not specified, the current date is used.
{
In this mode you can also send additional info that allows to create validated signals. Format to send additional info is
"device": "DEVICE TOKEN",
"date": "DATE",
"signals" : [
{
"name": "SIGNAL TOKEN",
"value": SIGNAL VALUE
},
...
]
}{ "device": "DEVICE TOKEN", "date": "DATA", "signals" : [ { "name": "SIGNAL TOKEN 1", "value": SIGNAL VALUE 1,
meta field is processed only at first communication when signal is created. If signal already exists additional info is ignored. No field is mandatory, you can send only which you need to set.
"meta": {
"description":"SIGNAL DESCRIPTION 1",
"type": "SIGNAL TYPE 1",
"unit": "UNIT OF MEASUREMENT SIGNAL 1",
"tags": ["TAG 1", "TAG 2", ...],
"chart_type": "CHART TYPE SIGNAL 1",
"accumulator": {
"active": true/false (signal is a counter),
"is_a_sum": true/false (signal is an incremental counter)
}
} }, ... ] } -
Forwarding signals with their values history. Each value has a specific date.
{ "device": "DEVICE TOKEN", "signals" : { "SIGNAL TOKEN": { "description": "SIGNAL DESCRIPTION", "history": [ { "date": "VALUE DATE", "value": SIGNAL VALUE }, ... ] }, ... } }
Example
Consider the device in figure:
- The device token is 0f6hbfnqz6
- Signas tokens are:
- Signal 1, signal_one
- Signal 2, signal_two
With the example data, supported push formats are:
-
{ "device":"0f6hbfnqz6", "signals": [ { "name" : "signal_one", "value" : 24.35156 }, { "name" : "signal_two", "value" : 16.92874 } ] }
-
{ "device":"0f6hbfnqz6", "signals": { "signal_one": { "history" : [ { "value" : 24.35156, "date" : "2020-08-04T09:30:00.000+0000" }, { "value" : 23.90625, "date" : "2020-08-04T09:31:00.000+0000" } ] }, "signal_two": { "history" : [ { "value" : 22.16728, "date" : "2020-08-04T09:30:00.000+0000" }, { "value" : 18.19027, "date" : "2020-08-04T09:31:00.000+0000" } ] } } }
0 Comments