v1

latestOpenAPI 3.0.12026-07-172011.0 KB
AirBeamMini fixed sessions binary flow

Create a new AirBeamMini fixed session

Creates a new fixed session for an AirBeamMini device. The mobile app calls this before configuring the AirBeamMini. The response includes a sensor_type_id per stream that the AirBeamMini uses to identify stream types in the binary upload payload.

Error Codes

error_codeHTTPDescription
unauthorized401Missing or invalid Authorization token
validation_error400Request body failed validation. See fields for per-field details
post/api/v3/fixed_sessions

Headers

Authorizationstring required

Token token=<user_token>

Request body

uuidstring uuid required
titlestring required
latitudenumber float required
longitudenumber float required
contributeboolean required
is_indoorboolean nullable

Whether the sensor is deployed indoors. Defaults to false when omitted.

time_zonestring nullable

IANA time zone identifier of the sensor location. Required for indoor sessions, which send placeholder coordinates (200, 200); used to convert UTC measurement timestamps to local time for display. When omitted, the time zone is derived from latitude/longitude.

Example request

{
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Rooftop PM2.5 monitor",
  "latitude": 40.7128,
  "longitude": -74.006,
  "contribute": true,
  "time_zone": "America/New_York",
  "airbeam": {
    "mac_address": "AA:BB:CC:DD:EE:FF",
    "model": "AirBeamMini",
    "name": "Roof sensor"
  },
  "streams": [
    {
      "sensor_name": "AirBeamMini-PM1",
      "unit_symbol": "µg/m³"
    },
    {
      "sensor_name": "AirBeamMini-PM2.5",
      "unit_symbol": "µg/m³"
    }
  ]
}

Response

session created

locationstring required
session_tokenstring required

Bearer token for AirBeam measurement uploads. The mobile app passes this to the AirBeam over BLE after session creation.

Example response

{
  "location": "http://aircasting.org/s/ab12c",
  "session_token": "a3f2c1d4e5b6a7f8c9d0e1f2a3b4c5d6",
  "streams": [
    {
      "sensor_name": "AirBeam-PM2.5",
      "sensor_type_id": 2
    }
  ]
}
All 2 operations