Chapter 5

mPower API Access

MPower API Access

Complete Administration via MQTT

The mPower API is a RESTful API that allows you to manage all aspects of the MultiTech Conduit platform.

GATE-Ware exposes the complete mPower API to the user. This allows you to manage the Conduit platform from your existing backend connection.

Single Pane of Glass

GATE-Ware’s API access over MQTT creates a single pane of glass for managing your complete Conduit deployment. The interface removes the requirement for UI configuration of your conduit, and removes and requirement for a VPN - especially beneficial when communicating via cellular, where VPN can consume large amount of data just by remaining connected.

mPower API access also allows you to manage your devices via scripting a series accesses via mPower API, which can then be run across conduits autonomously from your own backend business logic.

> Click to get started with accessing the mPower API via GATE-Ware

Sending Requests

Topic Structure

Requests

mPower API requests should be sent to the topic:

gateware/[conduit_serial|broadcast]/mpower/[method]

The conduit_serial is the serial number of the Conduit. Alternatively, the broadcast topic can be used to send the request to all Conduits.

The method is the HTTP method to use for the request. The following methods are supported:

  • get
  • post
  • put
  • delete

Responses

mPower API responses will be sent to the topic:

gateware/[conduit_serial]/mpower/[method]

Message Format

Requests

Refer to the mPower API documentation for API details: https://www.multitech.net/developer/software/mtr-software/mtr-api-reference/collection-endpoints/

The message payload should be a JSON object with the following fields:

{
  "headers": [],
  "message_id": "unique message id",
  "payload": "{}",
  "query_string": "status",
  "topic": "gateware/21560532/mpower/get"
}
  • headers - An array of HTTP headers to send with the request. Each header is a string, for example: Header: value.
  • message_id - A unique message id. This is used to correlate the request with the response.
  • payload - The payload to send with the request. This is optional and can be an empty string.
  • query_string - The value of query_string will be appended to the URL of the request. For example, if the query_string is status, the URL of the request will be https://127.0.0.1/api/status.
  • topic - only required for Azure, where the MQTT topic is not available. The value of topic will be used as a replacement for the MQTT topic.

Responses

{
  "topic": "gateware/21560532/mpowerresponse/get",
  "payload": {
    "code": 200,
    "result": [],
    "status": "success"
  },
  "message_id": ""
}