akenza.io
WebsiteAPI DocumentationWhat's newLogin
  • Overview
  • Getting Started
    • Connect a Device
  • Changelog
  • General
    • Applications
    • Organization context
    • Workspace Context
    • Users
      • User Roles
  • Device Management
    • Managing an organization
      • API keys
      • Users (Organization)
        • Add & removing users from your organization
    • Managing a workspace
      • General Settings
        • Device Lifecycle Reports
        • Workspace properties
        • Occupancy settings
        • Device Setup Assistant
      • Custom fields
      • Tags
      • Users (Workspace)
    • Devices
      • Device
      • Device Simulator
      • Bulk actions
      • Bulk import CSV templates
    • Rules
      • Input
      • Logic blocks
        • Comparison
        • Custom Logic
          • Logic Block Scripting
      • Timed Rules
      • Rule Actions
        • Downlink
    • Data Flows
      • Device Connectors
        • Device Security
          • Using Device Credentials
            • Creating Public/Private Key Pairs
            • Using JSON Web Tokens (JWTs)
              • Python
              • Java
        • HTTP
        • MQTT
        • CoAP
        • LoRaWAN
          • Connectivity Management
          • Swisscom LoRaWAN
          • The Things Network
          • Loriot
          • Actility’s ThingPark Wireless
          • EWZ
          • Cibicom
          • Helium
          • ChirpStack
        • NB-IoT
        • mioty
        • Disruptive Technologies
        • VergeSense
        • Spaceti
        • Haltian
      • Device Types
        • Custom Device Types
          • Uplink
          • Downlink
          • Scripting
        • Library
      • Output Connectors
        • Databases
          • akenza DB
          • InfluxDB
          • SQL Databases
        • Streaming
          • Webhook
          • Azure IoT Hub
          • AWS Kinesis
          • Google Cloud Pub/Sub
          • Apache Kafka
        • Notifications
          • E-Mail
          • SMS
          • Microsoft Teams
          • Slack
    • Custom Components
    • Integrations
    • Reference
      • REST API
        • Filtering
        • Querying Device Data
        • Schema inference
      • WebSocket API
      • Scripting
        • Stateful Operations
        • Utility Functions
      • Payload Templating
  • Reference
  • Dashboard Builder
    • Managing Dashboards
      • Embedding dashboards
    • Components
      • Map
      • Floorplan
  • Device Setup Assistant
    • Device Setup Assistant - Overview
  • Tutorials
    • BI Tools
      • Grafana Data Source Plugin
      • How to build a dashboard with Retool
      • How to analyze data with AWS QuickSight
    • Devices
      • How to integrate the XDK device from Legic via MQTT on akenza
      • How to connect the Disruptive Technologies-cloud on akenza
      • How to send Downlinks to the Kuando Busylight device
      • How to integrate an Arduino device via MQTT on akenza
      • Integrate a MClimate Vicki LoRaWAN Radiator Thermostat on akenza
      • How to integrate an ERS Elsys device with Loriot on akenza
      • How to integrate the IAM Decentlab device with TTN on akenza
      • How to integrate the Seeed SenseCAP T1000 tracker on akenza
      • How to integrate a Swisscom Multisense device on akenza
    • Notifications
      • How to send SMS notifications
      • How to send notifications to Slack
      • How to send notifications to Microsoft Teams
    • Enterprise solutions
      • How to send data to Azure IoT Hub
      • How to send data to the Google Cloud Pub/Sub
      • How to send data to InfluxDB
      • How to send data to AWS Kinesis
      • How to send data to Azure Event Hubs with Apache Kafka
    • IoT Starter Kits
      • How to integrate the IAQ Kit with Actility on akenza
      • How to integrate the CoWork Kit with Actility on akenza
      • How to integrate the Smart Building Kit with Actility on akenza
      • How to integrate the Pepperl+Fuchs Kit with Actility on akenza
  • Support Center
    • FAQ
    • Status Page
    • Service Desk
    • Request a feature
  • Deprecated
    • SIM-Cards
    • Everynet
    • Sigfox
    • How to connect the Yanzi Lifecycle cloud on akenza
Powered by GitBook
On this page

Was this helpful?

  1. Device Management
  2. Reference
  3. REST API

Schema inference

PreviousQuerying Device DataNextWebSocket API

Last updated 2 days ago

Was this helpful?

Each device has its own , describing which type of data is available on which topic. This schema can be inferred from the stored data and queried over the REST API. The inferred schema is combined from both device type schema and effective data that is measured by the device. The device type schema can be used to further annotate the underlying data model and units.

Infer schema

GET https://api.akenza.io/v3/devices/{deviceId}/infer-schema

Infer the schema of a device identified by its id

The /infer-schema/ endpoint returns a maximum of 50 topics.

Query Parameters

Name
Type
Description

deviceId

String

akenza device id of the sensor

Response example

{
    "lifecycle": { // topic
        "$id": "https://akenza.io/dynamic/08fe4bc0d0994882/lifecycle.schema.json",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Lifecycle",
        "type": "object",
        "properties": {
            "batteryVoltage": { // data key
                "title": "Battery Voltage",
                "type": "number",
                "inferred": true,
                "properties": {}
            },
            "batteryLevel": {
                "title": "Battery Level",
                "type": "number",
                "inferred": true,
                "properties": {}
            }
        }
    },
    "default": {
        "$id": "https://akenza.io/internal/deviceSimulator/default.schema.json",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Default",
        "type": "object",
        "properties": {
            "illuminance": {
                "title": "Light",
                "unit": "lx",
                "$ref": "https://raw.githubusercontent.com/akenza-io/device-type-library/main/data-models/environment/schema.json#/$defs/illuminance/lux",
                "measurementType": "akenza/environment/illuminance/lux",
                "type": "number",
                "description": "Light value",
                "properties": {}
            },
            "light": {
                "title": "Light",
                "type": "number",
                "inferred": true,
                "properties": {}
            },
            "co2": {
                "title": "CO2",
                "unit": "ppm",
                "$ref": "https://raw.githubusercontent.com/akenza-io/device-type-library/main/data-models/environment/schema.json#/$defs/co2/ppm",
                "measurementType": "akenza/environment/co2/ppm",
                "type": "number",
                "description": "Carbon Dioxide in ppm",
                "properties": {}
            },
            "sound": {
                "title": "Sound",
                "unit": "dB(A)",
                "$ref": "https://raw.githubusercontent.com/akenza-io/device-type-library/main/data-models/environment/schema.json#/$defs/soundLevel/dba",
                "measurementType": "akenza/environment/soundLevel/dba",
                "type": "number",
                "description": "Average value of the sound pressure level in decibel",
                "minimum": 20,
                "maximum": 120,
                "properties": {}
            },
            "temperature": {
                "title": "Temperature",
                "unit": "°C",
                "$ref": "https://raw.githubusercontent.com/akenza-io/device-type-library/main/data-models/environment/schema.json#/$defs/temperature/celsius",
                "measurementType": "akenza/environment/temperature/celsius",
                "type": "number",
                "description": "Temperature in degrees Celcius",
                "properties": {}
            },
            "humidity": {
                "title": "Humidity",
                "unit": "%",
                "$ref": "https://raw.githubusercontent.com/akenza-io/device-type-library/main/data-models/environment/schema.json#/$defs/humidity/percent",
                "measurementType": "akenza/environment/humidity/percent",
                "type": "number",
                "description": "Relative humidity in percent",
                "minimum": 0,
                "maximum": 100,
                "properties": {}
            },
            "occupied": {
                "title": "Occupied",
                "$ref": "https://raw.githubusercontent.com/akenza-io/device-type-library/main/data-models/spaces/schema.json#/$defs/occupied/boolean",
                "measurementType": "akenza/spaces/occupied/boolean",
                "type": "boolean",
                "description": "Whether the space is occupied",
                "properties": {}
            }
        }
    }
}
Data Schema