Skip to main content
This is a public API!
A third‑party app sends control commands to field devices and receives both an immediate command acknowledgement and an eventual state‑change notification.

Transport & Topics

  • Publish commands to: resource/commands
    QoS: 2 (exactly‑once delivery negotiated by MQTT)
  • Subscribe for responses & notifications: application/third-party/appName/instanceId
Always include a unique correlationId in requests and verify the same value in responses/notifications. JWT must be valid; otherwise the gateway returns an error response.
Allways subscribe to topic application/third-party/appName/instanceId where appId value is appName.instanceIdin request payload!

Message Envelopes (Common)

Command Request

Command Response

Notification (Async)

Responses typically acknowledge queuing (e.g., result = “sent”), while notifications carry the final device state. Treat notifications as the source of truth for UI state.

1) setExtDO Command

Set an external digital output (relay/DO) to on/off.

Request

Parameters

  • resourceId (number) – Target device identifier.
  • output (number) – Output index/port (1‑based unless otherwise provisioned).
  • status (number) – Desired state: 1 (on/closed), 0 (off/open).
Some deployments may validate output ranges per model; invalid ports will yield an error response.

For this example (due to "appId": "flexyWattApp.1"); subscribe to topic application/third-party/flexyWattApp/1 or application/third-party/flexyWattApp/# (for all instances) to receive responses and async notifications.

Immediate Response

Error Response (Example)


State‑Change Notification

Emitted when the device confirms the output’s actual state.
Use the pair (resourceId, output) plus correlationId to de‑duplicate and to reconcile UI state after reconnects.

Consumer Guidance

  • QoS & retries: Expect duplicate deliveries at QoS 1. Make handlers idempotent.
  • Timeouts: If no notification arrives, surface the queued state and allow users to retry.
  • Security: Store tokens securely; rotate when expired; never log full JWTs.
  • Tracing: Log correlationId on both publish and receive paths for observability.