Ingest api: adding external sensor data to ZENSIE


Creating import checks
The first step is creating import checks. An import check contains all the data of a sensor and creates an endpoint to which values can be sent. Import checks can be created by navigating to the checks view. At the bottom right, the plus button can be clicked to add a new sensor. We then can click on the external sensor option

We fill in the name, select the sensor type and click create.

Sensor types
Sensor types contain the definition of how data is formatted and should be displayed. A sensor type contains information such as the metric + unit (e.g. Temperature = ºC), data types and expected json values. Feel free to contact us if a new sensor type should be added.

Sending data to an import check
The last step is sending data to the api. After saving the check, we see the settings page. Here the endpoint is shown with an example call.

We can do a post to

https://api.30mhz.com/api/ingest/organization/www.30mhz.com

 

With these values (values change based on import check and sensor type):

[ 
  { 
  "checkId": "import_check_id", 
  "timestamp": "long (seconds-since-the-epoch)", 
  "data": 
    {
      "temp": "double", 
      "hum": "double" 
    }, 
  "status": "ok || fail", 
  "error": "custom error text message" 
  } 
]

 

Notice that we are sending the values inside an array. We can send multiple sensor values (multiple import checks) in one call:

[{import_check_1...},{import_check_2...},{etc...}]

 

API Keys
Make sure you add your api keys to the Authorization header: find out how to generate and use api keys.

 

Go back to documentation