I’m sure everybody has heard about IoT or Industry 4.0 and those terms. The question came to me which role the APIs play in the world of Things and Devices. Are they still needed when everything “magically” connects with each other?
There are two worlds in IoT, the one you know from your house – consumer IoT – and the world of Industrial or Enterprise IoT.
In your private life, you might have a fitness tracker or smart watch. These devices also somehow belong to the Things Space. They are sensors collecting information. Usually those devices are firstly connected to your phone via Bluetooth. You phone takes the role of connecting them to the Internet and further to the provider which offers services to you. Usually in form of an app that gives you insights to your data like statistics on the number of steps you have done per day etc. The connection from these apps to the provider is usually done via APIs. The APIs work as data pipes to send the data off to the cloud and retrieving the metrics and suggestions back. Some apps work standalone but quite often the provider does the “heavy lifting” on the cloud.
You might think about smart devices in your household which asked you to provide Wireless Access to get Internet. Those Things directly communicate with the provider and send data to the provider’s backend which is often running in the Cloud. Philips Hue Lights or Wemo Switches do this either themselves or using a local Gateway which provides this wireless link. Sometimes the sensors do this using API calls based on REST, Websockets or even proprietary protocols. These days IoT Protocols like MQTT become more and more popular to connect the power and compute constrained devices to the backend.
MQTT offers some advantages, as it was designed to work in environments which do want to send small portions of data frequently like temperature, humidity and others but also allowing to run on systems with less compute or memory. On the other hand the protocol has some constraints in terms of security which need to be taken into account too.
IoT devices leveraging MQTT over Websockets can be considered similar to new and modern browsers like Chrome supporting Websockets. This allows to exchange data in a quick and unconstrained way compared to Webhooks or API polls.
Facebook has adapted this approach for their Messenger App and achieved decrease in latency improving user experience massively. Still the Messenger uses the existing Facebook APIs together with MQTT and Websockets. This example shows that APIs play an important role in the Internet of Things and are used together with IoT Protocols.
Industrial / Enterprise IoT
In Enterprise or Industrial IoT, a few very often promoted use cases come to mind like “Predictive Maintenance“, “Fleet Management“. Quite often companies decide to use an IoT Platform to connect all devices. IoT Platforms provide a number of core capabilities such as:
- Connect: create and manage the link from the device to the internet
- Secure: protect IoT devices, data, and identity from intrusion
- Manage: control the provisioning, maintenance, and operation of IoT devices
- Analyze: transform data into timely, relevant insight and action
- Build: create applications and integrate with enterprise systems
Most of these IoT platforms provide APIs to integrate with existing IT but not all contain a full fledged API Management Solution for API Lifecycle management but also for monitoring, API security and consumer management.
Some enterprises want to start small and do some first tests with their IoT ideas. In order to be able to support those type of use cases allowing to send and receive IoT Data via MQTT and connecting them to the world of APIs, Axway has developed two Open Source Components that are available on their Axway Marketplace.
But not only the connectivity of devices is a big topic in IoT Projects, Rapid Mobile App Development is a must have as well as proper Metrics and Analytics on top of IoT Data.
Components to connect the IoT to APIs
Below the list of the two components proposed by Axway to connect to the Internet of Things to APIs:
mqtt-proxy allows to apply policies on MQTT events (connect, subscribe …) by reaching out to a server via HTTP. This can be used for example to check user name and password on MQTT against an Axway API Management REST-API.
mqtt-trigger subscribes to MQTT topics and triggers REST-API calls based on a ruleset via HTTP when new messages are received. For example, calling API Management when a new message is received on a specific topic.