Webhooks, often referred to HTTP callbacks, enable LoopCloud to push data to web applications. Webhooks are asynchronous and have triggered events and responses. As with Poll models, which retrieve data from external web services, you can use Webhooks to retrieve data from an external system and push that data to the Loop platform. Webhooks create a web service (HTTP endpoint) that allows you to push data to LoopCloud or a third-party system.
Webhook Use Cases
In addition to MQTT and LwM2M, LoopCloud supports incoming webhooks as a mechanism for receiving data from external systems.
- Incoming webhooks are basically REST endpoints.
- Transformation rules can convert incoming data to a format supported by the Loop platform. See Webhook Model Transformation.
Example Webhook Case
SigFox acts as an IoT sensor network and it allows users to define Webhooks to invoke upon each sensor metric change. See SigFox Transformation Example.
Create a Webhook Model
To create a Webhook Model with LoopCloud:
- Click the Company name at the top of the LoopCloud window.
- Click the Project.
- In the navigation panel, choose Configuration > Models.
- Select the WEBHOOK tab. See also, Model Types.
- Click New Model.
- In the CONFIG tab:
- Enter a Model Name.
- Notice that the Access Token field gets populated automatically.
- Click Save.
When you deploy a device from a Webhook model, the Webhook will be available as a URL in the following format:
Webhook Model Transformation
- See Poll Model to Transform Data for a description of transformation.
SigFox Transformation Example
You can define transformation rules, as shown in the following example. The following rules convert incoming data into a format supported by the Loop platform.