Like most websites, 30MHz uses cookies to remember you so that we can deliver an optimised browsing experience. Select ‘Accept all’ if you’re okay with accepting cookies from UserEngage (webchat and lead generation), Hotjar (website improvement) and LinkedIn (tailored ads). When you select ‘Accept only necessary’, we will place cookies that let you use our website properly by remembering your preferences and for anonymous statistics. For more information, please see our cookie policy and privacy notice.

Accept all
Accept only necessary

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. Read here on how to create your own sensor type

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/30mhz.com

 

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

[ 
  { 
  "checkId": "import_check_id", 
  "timestamp": "A valid ISO 8601 DateTime format value with an explicitly set timezone value (e.g. 2017-01-17T19:23:02Z, 2017-01-17T19:23:02+06:45).", 
  "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

Sign up for our monthly news letter

Get news and updates directly in your mailbox.