Flows

API Calls for Node-RED Flows

Used get and set the full configuration the flows.

Get flows configuration

GET/api/v1/mobius/flow/{hid}
Path parameters
hid*string

MobiusFlow Hub ID

Example: "000001"
Pattern: ^[0-9A-Fa-f]{6}$
Response

Ok response

Body
ts*string

Timestamp of the response

Example: "2022-12-21T10:25:54.585Z"
uri*string

URI of the response

Example: "000001"
data*array of object

Array of flow configurations

Request
const response = await fetch('/api/v1/mobius/flow/{hid}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "ts": "2022-12-21T10:25:54.585Z",
  "uri": "000001",
  "data": [
    {
      "id": "3423ebadc41ce452",
      "type": "tab",
      "label": "Flow 1",
      "disabled": false,
      "info": "",
      "env": []
    },
    {
      "id": "dd17eb69b4c36475",
      "type": "mobius connection",
      "host": "localhost",
      "port": "1890",
      "psk": "node-red"
    },
    {
      "id": "64328273c1ade1ed",
      "type": "mobius resource cov",
      "z": "3423ebadc41ce452",
      "name": "",
      "detailedOutput": false,
      "resource": "000001/020/000D/0001/40",
      "connection": "dd17eb69b4c36475",
      "x": 330,
      "y": 100,
      "wires": [
        [
          "19d9af2e1a4761ac"
        ],
        []
      ]
    },
    {
      "id": "19d9af2e1a4761ac",
      "type": "debug",
      "z": "3423ebadc41ce452",
      "name": "debug 1",
      "active": true,
      "tosidebar": true,
      "console": false,
      "tostatus": false,
      "complete": "false",
      "statusVal": "",
      "statusType": "auto",
      "x": 620,
      "y": 100,
      "wires": []
    }
  ]
}

Set flows configuration

PUT/api/v1/mobius/flow/{hid}
Path parameters
hid*string

MobiusFlow Hub ID

Example: "000001"
Pattern: ^[0-9A-Fa-f]{6}$
Body

Array of flow configurations

Other propertiesany
Response

Ok response

Body
ts*string

Timestamp of the response

Example: "2022-12-21T10:25:54.585Z"
uri*string

URI of the response

Example: "000001"
data*string

Set achknowledgement

Example: "OK"
Request
const response = await fetch('/api/v1/mobius/flow/{hid}', {
    method: 'PUT',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify([
      {
        "id": "6aa8ab4d100707b8",
        "type": "tab",
        "label": "Pigs will fly",
        "disabled": false,
        "info": "",
        "env": []
      },
      {
        "id": "f3e2539aafeaa03c",
        "type": "azureiotdevice",
        "z": "6aa8ab4d100707b8",
        "deviceid": "A00001_021_012D_0001",
        "pnpModelid": "",
        "connectiontype": "dps",
        "authenticationmethod": "sas",
        "iothub": "",
        "isIotcentral": true,
        "scopeid": "0ne004C4815",
        "enrollmenttype": "device",
        "saskey": "UhjPQxY299AdQ3/TVL2kHFIi36a/cpWTUT/0BJvZjAg=",
        "certname": "",
        "keyname": "",
        "passphrase": "",
        "protocol": "mqtt",
        "retryInterval": 10,
        "methods": [],
        "DPSpayload": "",
        "gatewayHostname": "",
        "caname": "",
        "cert": "",
        "key": "",
        "ca": "",
        "x": 920,
        "y": 120,
        "wires": [
          []
        ]
      }
    ]),
});
const data = await response.json();
Response
{
  "ts": "2022-12-21T10:25:54.585Z",
  "uri": "000001",
  "data": "OK"
}

Last updated