Webhook is a technical name to indicate a web-based notification that sends a message to an URL when certain actions happen.
We have recently launched a new system to configure webhooks.
If you already configured webhooks before the upgrade to 7.15, then you will be temporarily able to use both systems.
Since the old system will be dismissed in the next few months (currently there is not a deadline for this, we will publish a note into the Admin Panel), we strongly recommend you to migrate to the new system as soon as possible.
Please note that the new system will send the data in a different JSON format.
If you are looking for a guide about the old system, please check here. Below you can find more information about the new system.
List of moments
Cloud4Wi allows you to set up a webhook the following types of events (moments):
- Sign-up: the event is triggered after a user is registered to the database (either registration from the Splash Page, Cloud4Wi Dashboard, or Kiosk)
- Login: the event is triggered after a guest user signs-in on the guest Wi-Fi
- Presence: the event is triggered after a user's device is detected by the access point
List of webhooks
You can find the list of webhooks in your Cloud4Wi Company Account, from Manage > Notifications.
You can check if an existing webhook is enabled or not, you can check on which location it is enabled, you can edit or delete it, or make a test call to the endpoint.
Create a webhook
To create a webhook you have to click on the Add button on the top of the page.
On the next page, you can set the following data:
- Name: name of your webhook, for inventory purposes
- Moment: the event that triggers the call
- URL: end-point of the HTTP POST request (for example https://yourdomain.com/myapps/webhook.com), The end-point of the HTTP POST request of the webhook can be HTTP and HTTPS; if https the server must be correctly configured in order to support the Server Name Indication (SNI) ( https://en.wikipedia.org/
- Headers: you can define any key-value header to include in your request
- Body: you can choose a list of information about the event, among a given list (etc. you may want to send first name, last name, email, etc.)
- Locations: a list of location where you want to configure the webhook
Find below the list of all the possible data returned:
How to migrate a webhook created with the old system
As already mentioned, the new system will send the data in a different JSON format.
If you want to configure a webhook sending the same information as the old version, you have to configure the headers below:
Configure the headers below:
Content-Type: application/json Accept-Charset: UTF-8 Cf-Ipcountry: IE Cf-Ray: 3882e1b1980f2969-DUB Accept: application/json Authorization: [[the value you had before for "Auth token"]]
Note: the old version had a field called "Auth token". Now you can configure the same parameters by adding a header parameter called "Authorization".
if you previously had "Auth token" = "1234567890", now you need to create a new header with key = "Authorization" and the value = "1234567890".
Configure the body parameters below:
- hotspot.id (the old system sent this info for "Sign-up" and "Login" moments only)
- event.dwellTime (the old system sent this info for "Dwell" moments only)
- event.nonce (the old system sent this info for "Presence", "Enter a zone", "Dwell" and "Leave" moments only)
- contact.online (the old system sent this info for "Sign-up" and "Login" moments only)
- contact.metrics.visitCount (the old system sent this info for "Sign-up" and "Login" moments only)
- contact.optin (the old system sent this info for "Sign-up" and "Login" moments only)
- contact.customFields (the old system sent this info for "Sign-up" and "Login" moments only)
You will no be longer able to get the following information: