For the complete documentation index, see llms.txt. This page is also available as Markdown.

MobiusFlow Engine Websocket

Usage of MobiusFlow Engine Websocket

The Engine websocket is a data interface which runs on top of the MobiusFlow Engine API on all MobiusFlow Engines.

The websocket allows for extraction of event driven data via a subscribe / unsubscribe model.

Unlike the base Engine API which operated on request/response model, the websocket pushes data to you. This means you do not have to set up regular data / event polling to remain up to date on the state of the MobiusFlow Engine.

Before using the Engine Websocket we recomend you're familar with the following:

The websocket allows subscriptions to the following MobiusFlow events:

See event types.

Connection Endpoint

Websocket connection endpoint exists on the MobiusFlow Engine Rest:

(GET)
/api/engine/v3/subscribe/connect

On initial connection, no authorization is required. This means you do not need to include any token within the request body or headers.

Authorization

Once the inital websocket connection is made, the server will expect a follow up authorization message within 30 seconds in the following format:

{
    "topic": "authorize",
    "payload": "Bearer 8e100e7bef9898963477f2c8a89eeedb8b679c221e446cf0249787119cc44b51e792b2a03d0ffb75ef68149c0cbea13d21c758443d44735027c25fecb7f9c992"
}

Where the token portion of the payload is a valid session token returned from an Engine API login call (/api/engine/v3/auth/login).

Note: The token is packaged in bearer token format (The prefix Bearer is applied) e.g. "Bearer XXXXX"

If no authorization call is received by the server, the connection will be dropped.

Following successful authorization, subscription to any engine events can proceed.

Subscribe / Unsubscribe

Event Types

Event Type
Notes
URI Format

COV

Change of value of a specific MobiusFlow resource. URI parameter refers to specific resource to subscribe to change events on.

(To resource level): XXXXXX/XXX/XXXX/XXXX/XX

OBCOV

Change of value of any resource within a given MobiusFlow object. URI parameter refers to specific object to subscribe to change events on.

(To object level): XXXXXX/XXX/XXXX/XXXX

SRVCSTATUS

Change of service status of a given MobiusFlow service. URI parameter refers to the service to subscribe to status change events on.

(To service level): XXXXXX/XXX

BCMD

Subscribe to any MobiusFlow broadcast commands. URI controls which service / services to subscribe to broadcast commands on.

(To service level): XXXXXX/XXX

Subscribe

Each event type can be subscribed to by sending messages in the following format:

Where <EVENT TYPE> is replaced by the event type (COV, OBCOV, SRVCSTATUS, BCMD).

For the BCMD event type the additional CMD property must be included to specify the command to you're subscribing too:

Where <CMD> should be replaced by any BCMD command type.

Unsubscribe

Unsubscribing is achieved in an identical manner except the message topic should read unsubscribe:

URI Wildcarding

All subscriptions can be wildcarded using standard URI wildcarding.

Last updated

Was this helpful?