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

Authorization

API Authorization calls

PreviousMobiusFlow Engine APINextDiscover

Last updated 5 months ago

The authorization controller is used to login to the API, in addition user management.

When a login call is completed, the API will return a bearer token which should be used in the auth header of all future calls. This token is set to expire 10 minutes after its generation.

A refresh token is also included in the login response, and this is used in the body of the refresh call to get new tokens with refreshed expiry times. Ensure a refresh call is made prior to any given bearer token's expiry to avoid having to login again.

⚙️

Get user ID

get
Path parameters
usernamestringRequired

Username

Responses
200
Ok response
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
get
GET /api/v1/auth/user/{username} HTTP/1.1
Host: 
Accept: */*
71abe4f9-c636-4b1c-950f-968459cea908

Get all users

get
Responses
200
Ok response
application/json
Responsestring[]

Ok response

Example: ["admin","bobz@home.com","chris@home.com"]
401
Unauthorized
application/json
500
Internal Server Error
application/json
get
GET /api/v1/auth/users HTTP/1.1
Host: 
Accept: */*
[
  "admin",
  "bobz@home.com",
  "chris@home.com"
]

Get user roles

get
Path parameters
_idstringRequired

User ID

Responses
200
Role profile
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
get
GET /api/v1/auth/user/roles/{_id} HTTP/1.1
Host: 
Accept: */*
{
  "admin": false,
  "flows": true,
  "configure": false,
  "subscribe": true,
  "write": true,
  "read": true
}

Delete a user

delete
Path parameters
_idstringRequired
Responses
200
Default Response
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
delete
DELETE /api/v1/auth/user/{_id} HTTP/1.1
Host: 
Accept: */*
{
  "result": "OK"
}
  • POSTLogin to engine API
  • POSTRefresh API tokens
  • POSTAdd a new user
  • GETGet user ID
  • GETGet all users
  • GETGet user roles
  • PATCHSet user roles
  • PATCHSet user password
  • DELETEDelete a user

Login to engine API

post
Body

Engine API Login credentials

usernamestringRequired

Username

passwordstringRequired

Password

Responses
200
Ok response
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
post
POST /api/v1/auth/login HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 55

{
  "username": "exampleUser",
  "password": "examplePassword"
}
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiIyYTZlMzQzNC1kZjI4LTQ1NDQtOTYzYS1mZTViMmQ1NTg0ZWIiLCJyb2xlcyI6MjU1LCJpYXQiOjE2NzMyODY1MjYsImV4cCI6MTY3MzI5MDEyNn0.eDnLoBQSp8mkI6C4rkgm1iBFL_dSPAWoYiXOtitaCAs",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiIyYTZlMzQzNC1kZjI4LTQ1NDQtOTYzYS1mZTViMmQ1NTg0ZWIiLCJyZWZyZXNoVG9rZW4iOnRydWUsImlhdCI6MTY3MzI4NjUyNiwiZXhwIjoxNjczMzI5NzI2fQ.TsB2JUhjh8I8dvJrXxVNL4anJKUO5j_sS2EL3x4c5SE"
}

Refresh API tokens

post
Body

Refresh token data

refreshTokenstringRequired

Refresh token

Responses
200
Ok response
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
post
POST /api/v1/auth/refresh HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 234

{
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiIyYTZlMzQzNC1kZjI4LTQ1NDQtOTYzYS1mZTViMmQ1NTg0ZWIiLCJyZWZyZXNoVG9rZW4iOnRydWUsImlhdCI6MTY3MTYxNzY2MiwiZXhwIjoxNjcxNjYwODYyfQ.Mwjbo13AQH-wyfuK_HI5sjwikUZSRboyHa6nkrkm-Xg"
}
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiIyYTZlMzQzNC1kZjI4LTQ1NDQtOTYzYS1mZTViMmQ1NTg0ZWIiLCJyb2xlcyI6MjU1LCJpYXQiOjE2NzMyODcyMDUsImV4cCI6MTY3MzI5MDgwNX0.T2D6l1AMMEbBJXshJjyyHjt1t7XUB5k35Vegusg2HZc",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiIyYTZlMzQzNC1kZjI4LTQ1NDQtOTYzYS1mZTViMmQ1NTg0ZWIiLCJyZWZyZXNoVG9rZW4iOnRydWUsImlhdCI6MTY3MzI4NzIwNSwiZXhwIjoxNjczMzMwNDA1fQ.AJxGVcUr0raGWYYUDY8hxq9It_gd7byodocjKuzo35I"
}

Add a new user

post
Body

New user data

usernamestringRequired

Username

passwordstring · min: 8Required

Password

Responses
200
Ok response
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
post
POST /api/v1/auth/user HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 147

{
  "username": "bobz@home.com",
  "password": "12345678",
  "roles": {
    "admin": false,
    "flows": true,
    "configure": false,
    "subscribe": true,
    "write": true,
    "read": true
  }
}
{
  "_id": "71abe4f9-c636-4b1c-950f-968459cea908"
}

Set user roles

patch
Path parameters
_idstringRequired

User ID

Body

New roles information

Responses
200
Ok response
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
patch
PATCH /api/v1/auth/user/roles/{_id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 97

{
  "roles": {
    "admin": true,
    "flows": true,
    "configure": false,
    "subscribe": true,
    "write": true,
    "read": true
  }
}
{
  "roles": {
    "admin": true,
    "flows": true,
    "configure": false,
    "subscribe": true,
    "write": true,
    "read": true
  }
}

Set user password

patch
Path parameters
_idstringRequired

User ID

Body

New password information

passwordstring · min: 8Required

New password

Responses
200
Ok response
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
patch
PATCH /api/v1/auth/user/password/{_id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "password": "text"
}
{
  "result": "text"
}