Introduction
In this guide, we will show how to create a webhook in the Onomondo app, using an example HTTPS endpoint, and see how events are reported in real time.
Before you try this yourself, consider getting familiar with the Tags feature and assigning a tag to one of the SIMs you would like to test webhooks with.
Creating a secure endpoint
First thing you will need to do is decide where you would like to receive information about your SIMs.
Here, we will illustrate how to create an endpoint with the following third-party services:
Make (fka Integromat)
The URLs created in this step will be needed later so make sure to save them.
Option A: Webhook.site
This is the easiest way to create a test endpoint and see how webhooks work in practice.
Go to Webhook.site.
Copy "Your unique URL".
Do not close the page. You will see events sent from your SIM here later.
Option B: Make
Make.com offers a free plan that includes the webhook integration and allows you set up a few automations, fx. notifications based on various SIM events sent to your email or Slack.
Create a free account and log in to Make.
Create a new scenario.
Click on the initial module, and select "Custom webhook" (found under "Webhooks").
Click "Add", give your webhook a name (fx.
"Test hook"
) and click "Save".Copy the generated URL.
Option C: Zapier
Zapier.com offers plenty of automation features, but webhooks are only included in the premium subscription. However, setting up an endpoint is very easy, and if you are a new user - you may benefit from a free trial that allows you to use webhooks for a limited time.
Log in to Zapier.
Create a new zap.
Click on "Trigger" and choose "Webhooks" from the list.
Go to event settings and set "Trigger event" to "Catch Hook" in the Setup tab.
Go to Test tab and wait a few seconds.
Copy the URL.
Option D: Your own custom endpoint
Alternatively, you can create your own endpoint at the server of your choice. You have to make sure that it's an HTTPS endpoint.
If your server has a firewall, you will have include public Onomondo webhook subnets in firewall settings. These IP ranges can also be found in our API documentation.
Webhook subnets:
3.65.45.209/32
35.158.167.193/32
52.58.186.11/32
To increase the security of data transfer, please ensure that your endpoint is hosted on a secure HTTPS web server. You can either use an endpoint provided by third-party services or develop your own, but make sure it has at least SSL encryption.
How to add a test webhook
Once you have set up the endpoint for the Webhooks:
Go to the webhooks tab the Onomondo app.
Click on "New Webhook" in the top left corner.
Give your webhook a unique name.
Paste the previously created URL.
Limit the webhook to a tag of your choice. Ideally, the tag should be paired with the SIM you're testing with.
Make sure the webhook is set to "Active".
Select the events you are interested in receiving. There are eight kinds of events to choose from:
Network Authentication - the device has asked to attach to the network.
Network Registration - the device has attached to the network.
Network Deregistration - the device has detached from the network.
Data Usage - per SIM, is updated every 15 minutes of activity or when a SIM deregisters from a network.
Device SMS - when a device sends an SMS to any number.
SMS Usage - separately for both outgoing and ingoing SMS.
Location Update - approximate location of the last cell tower the device attached to, sent every time the device connects to a new cell.
Usage Alerts - when a device reaches a usage alert threshold (optional) or is blocked by usage limit.
β
If you want to learn more about different event types and their applicability in different use cases, see this guide:
8. Once you've set everything up, click on "Create webhook".
9. Turn on the device with the test SIM.
10. See what is delivered to your designated endpoint
Example: Get notified when your device comes online
For the sake of this guide, we will create a webhook that captures authentication and registration events as soon as the device comes online, sent to webhook.site.
The setup would look like this:
β
Once you power on your device and it connects to one of the local networks, you will see in the Network Logs.
The authentication and registration on the GSM network will be displayed like this:
Correspondingly, these events are delivered to the endpoint at webhook.site. As you can see, the webhook object corresponds directly to the triggered event, and contains specific information about the SIM, as well as network the device connected to.
Based on this webhook, every time the device authenticates or registers with the network - you will get notified instantly. No need to keep an eye on your SIMs in the Onomondo app at all times.
Thanks to tags, you can pair this webhook with any number of SIMs of your choice.
Now, it's up to you to decide how to ingest this data and act upon it. Consider exploring Make's and Zapier's automations to design custom triggers and events.
Want to see a more detailed example? Here is a guide on how to get notified every time your device sends SMS and how to trigger custom actions using Make:
How to edit a webhook
It is easy to also edit an existing and running Webhook.
Go to the Webhooks tab in the Onomondo app and click the "Edit" icon next to the previously created Webhook.
You can edit:
Name
URL
Tags
Active status
Events
When you're done making changes, click "Submit". Your updates will take effect immediately.
β
Customizing webhooks for use cases
IoT deployments can quickly become large. Receiving all events for all SIMs and altering it on the backend requires development time and resources.
Taking advantage of Tags, Webhooks can be customized for specific uses.
Use case examples:
Tracking network registration events in a test country
Monitoring data usage
Catching SMS content and error codes outside of the Onomondo app
Monitoring events of a development kit to help monitor how it is functioning
Mapping location events of a specific product
β
What is the data being sent?
You can find more information about the data structure of different Webhooks events in the relevant section of our API documentation.
If you have any further questions, you are welcome to send us your questions to support@onomondo.com.