MobiusFlow Docs
Main WebsiteRaise a Support Ticket
  • Welcome
  • What is MobiusFlow®?
  • 📖User Guides
    • MobiusFlow Manager
    • MobiusFlow Toolbox
    • Getting Started
      • Administration
      • Service and Object Configuration
      • Diagnostics and Service Control
      • Running MobiusFlow via Docker
    • Deploying MobiusFlow in MobiusFlow Cloud
    • Deploying MobiusFlow On-Prem
      • Deploying MobiusFlow to approved Hardware (Using BalenaCloud)
        • Creating a Fleet
        • Adding Your First Device
        • Deploy MobiusFlow to Your Fleet
        • Adding Your Licence
        • Installed Services
        • Device Variables
        • Configure Networks
      • Deploying MobiusFlow on Customer Servers / Cloud
    • MobiusFlow Connectors
      • Configuring MobiusFlow for use with Connectors
      • MobiusFlow Official Connector
        • Connection Details and LED Indicators
        • Configuring a Connector
          • Home Page
          • Configure Network Page
          • Manage Certificates Page
          • Configure MQTT Page
          • Set Config Mode Password Page
          • About Page
        • Factory Resetting a Connector
      • MobiusFlow Raspberry Pi Connector
        • Converting Raspberry Pi to a MobiusFlow Connector
        • Configuring Raspberry Pi Connector
    • Technical Training Guides
      • Technical Training 1
  • ⚙️Technical Docs
    • MobiusFlow Cloud Hosted Environment
    • MobiusFlow Basics
      • MobiusFlow Overview
      • MobiusFlow Architecture
      • MobiusFlow Uniform Resource Identifiers (URIs)
      • Security
        • MobiusFlow Internal Security
      • Backup and Restore
      • Ports and Endpoints
    • MobiusFlow Engine API
      • Authorization
      • Discover
      • Node
      • Service
      • Object
      • Profiles
      • Command
      • Flows
      • Subscription
      • Licence
    • MobiusFlow Services
      • DALI Lighting
        • DALI via AFDWeb MQTT
      • LoRaWAN Local Network Server
      • MobiusFlow Connectors
      • INGY Lighting
      • Object Store
      • EnOcean Devices
        • EnOcean Equipment Profiles (EEPs)
    • Flows
      • Connecting the Flows to MobiusFlow Engine
      • Data Transfer between Flows and MobiusFlow Engine
      • Further Data Transfer between Flows and MobiusFlow Engine
      • Receiving and Sending Raw EnOcean Telegrams
    • Licencing
      • Licensing (v1.19.1 and later)
  • Glossary
Powered by GitBook
On this page
Export as PDF
  1. Technical Docs
  2. MobiusFlow Engine API

Subscription

API Subscription Websocket

PreviousFlowsNextLicence

Last updated 5 months ago

Full functionality of Subscription Websocket is described in the connect call below.

⚙️

Route used to connect to subscription websocket

get

Upon making this request, the server will upgrade to websocket connection. The websocket can then be used to manage subscriptions to MobiusFlow object COVs (change of values), resource COVs, service status changes and broadcast commands. Once the connection is initally established, the websocket server sends back a connected message, featuring the topic 'connected' as shown below. Once the upgrade is complete, all subsequent subcription communications are performed via websocket messages.

Following the inital http connect call, the now upgraded websocket connection expects a follow up authorization websocket message within 10 seconds. The authorization websocket message must feature the topic 'authorize' and a payload containing the API bearer token. An example message is shown below:

On successful authorization, the websocket server will send back a confirmation message, containing the topic 'authorized' as shown below.

If no authorization message is received by the websockeet server within 10 seconds, the connection is dropped by the server.

Each subscription or unsubscription message must contain topic 'subscribe' or 'unsubscibe' respectively. Additonally, each message must feature a payload containing both the subscription type and subscription URI. Valid subscription types are denoted in the following table:

Note, the URI field may contain MQTT style wildcards where appropriate.

An example subscibe message is shown below:

Following a successful subscription or unsubscripton message, the websocket server will echo the message back to the client, confirming the action has been made.

Each event response will feature a timestamp, topic and payload. The topic will be one of the valid event types as denoted in the above table. The payload will contain uri and value fields, the form of the latter varrying based on the type and nature of the event. An example response is shown below:

The values for each event type are as follows:

Responses
101
Switching Protocols
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
404
Not Found
application/json
408
Request Timeout
application/json
500
Internal Server Error
application/json
get
GET /api/v1/mobius/subscribe/connect HTTP/1.1
Host: 
Accept: */*
{
  "topic": "connected"
}