Data collection
Introduction
API to send raw IoT data to OpenGate.
HTTP data collection
This section shows how to use OpenGate HTTP connector for data collection.
The endpoint allows devices to send raw data to OpenGate.
It can be done by:
- sending data points with their respective timestamps in different datastreams in a single request
- sending data points without timestamp in different datastreams in a single request
Note about data streams with special platform processing
Besides the spec info you can find below, it’s worth considering that there are two data streams with special platform processing rules: device.identifier and device.topology.path.
These data streams match fields outside the list of data streams in the collection JSON. Due to this special treatment, these data streams will never be collected from the list of data streams; they will be collected from their fields in the collection JSON.
If you want to collect the data stream device.topology.path you have to fill in the field path of the collection JSON. Or, in case of the device is directly behind a gateway, you can remove the field path and fill in the field device in the collection JSON, OpenGate will collect the data stream device.topology.path with the gateway identifier.
Also, if you want to collect the data stream device.identifier you have to fill in the field device of the collection JSON. If you don’t fill in this field, OpenGate will collect the data stream device.identifier from the device_id (that is, the gateway) in the URI, and all the data in the data streams array will be stored in the gateway collected info.
Usage examples
Send the latest value of each data stream (no timestamp):
Send one data stream with several timestamped data points:
A valid request returns HTTP 201.