Mithra Public API
API Docs
API Docs
  1. Realtime (SSE)
  • Mithra Public API
  • Realtime (SSE)
    • SSE Event Schema
    • Connect (SSE)
      GET
    • Subscribe (SSE)
      POST
  • List Sensors
    GET
  • List Locations
    GET
  • Sensor Readings
    GET
  1. Realtime (SSE)

SSE Event Schema

After subscriptions are added, objecfts of sensor_measurement and client_push will be sent to the already setup connection (using the GET call). The received message format can be expected based on the subscriptions added.

Workflow#

1.
Connect to the SSE endpoint (GET)
2.
Use the clientId obtained from the Connect step to add subscriptions (POST)

sensor_measurement#

New data has been received from the sensor. You can call the Sensor Readings endpoint to fetch details.
{
    "type": "sensor_measurement",
    "client_id": "0083vz18243vo5n",
    "sensor_id": "2a41z7t93z046ep",
    "measurement_id": "7idezffwlbkjh2c",
    "rssi": -33,
    "sec_since_last_msg": 60,
    "gwno": 2
}

client_push#

A new push notification has been sent to the user device(s).
{
    "type": "client_push",
    "title": "Some title",
    "message": "Some message",
    "client_id": "0083vz18243vo5n",
    "sensor_id": "04tf2tzyc2m868q",
    "gateway_id": "",
    "push_id": "8eix0igluk6la4n",
    "badge": 1,
    "color": "",
    "sound": "default",
    "messages_sent": 12
}
Previous
Mithra Public API
Next
Connect (SSE)
Built with