post https://api.things5.digital/v1/devices//ingest
Use this endpoint to send all the data that the device is generating: metrics, states and events.
Pay attention to data order and timestamp
Timestamps need to be incrementally sorted within and across the requests.
For each variable, any timestamp older than one already received will be discarded.
Timestamp must be in milliseconds!
Payload Parameters
type | desctiption | example |
---|---|---|
metrics | Any kind of value that contribute to define a measure. | A measure like "speed" or "temperature" |
states | Define the situation of the device that will last until the next status is defined. | The status of a door, that can switch from "open" to "close" |
events | Define the situation of the device in a specific point in time. | A alarm that triggers and immediately fade off |
Payload Representation
{
"metrics": [
{
"timestamp": 1500000000030,
"data": [
{
"name": "temperature_core",
"value": 19
},
{
"name": "temperature_room",
"value": 22
}
]
},
{
"timestamp": 1500000000040,
"data": [
{
"name": "temperature_core",
"value": 23
},
{
"name": "temperature_room",
"value": 29
}
]
},
{
"timestamp": 1500000000070,
"data": [
{
"name": "temperature_core",
"value": 31
},
{
"name": "temperature_room",
"value": 40
}
]
}
],
"states": [
{
"timestamp": 1500000000020,
"data": [
{
"name": "door",
"value": "open"
},
{
"name": "status",
"value": "defrost"
}
]
}
],
"events": [
{
"timestamp": 1500000000010,
"data": [
{
"name": "high-pressure-alarm",
"metadata": {
"temperature": "22"
}
}
]
}
]
}