July 13, 2020

SensMax API methods for getting data from SensMax real-time reports

This document describe API methods which allows to get data from LiveReport and GO-STOP reports from my.sensmax.eu

API key

To get the API key, please go to your profile settings, and press the Get API key link.
You will need to enter your password again.

The example of http request header:

GET /api/v2/sensors HTTP/1.1
HOST: my.sensmax.eu
apikey: e4a137c95a756b2110c6485050db57b027454571d3c3a5dafb4d36e1f51746ef

Getting report results

Request:

GET https://my.sensmax.eu/api/v2/report/<report_id>

Where <report_id> you can get after create report from share form, or in url to report.

The answer is JSON that contains the following structure:

{
  "id": 4242, // sensor group id (used in reset request)
  "name": «My Shop", // sensor group name
  "date": "2020-06-09 18:14 +04:00", // datetime when last data update
  "currentTime": "2020-06-09 18:14 +04:00", // current datetime with timezone setting on profile user
  "inside": 0, // current value of visitors inside
  "max": 7, // limit visitors inside
  "almostFullPreset": 5, // limit almost full visitors inside
  "offline": false, // turn on true when any sensors in group is offline
  "color": "green", // color for text
  "message": "Welcome!", // message for current value visitors inside
  "messageWhenLimitReached": "The shop is full",
  "messageWhenAlmostFullReached": "The shop is almost full",
  "messageWhenFree": "Welcome!"
  }

Reset current value of visitors inside

Request:

POST https://my.sensmax.eu/api/v2/report/<report_id>/settings/sensor-groups/<sensor_group_id>/reset

With body:

{
  "visitors_on_reset":1
}

Where <report_id> you can get after create report from share form, and <sensor_group_id> you can get from answer to request before.

The answer is JSON that contains the following structure:

{
  "time": "2020-06-09 15:48 +04:00",
  "success": true,
  "visitorsonreset": 1
 }