Webhooks – Expand your options

With Cloud Notify you can receive real-time notifications from your machine(s) in a robust and safe way. By connecting an external application via webhook, you can expand your options even further. Think about a chain of recipients (first person one gets a message, if he doesn’t respond, person two gets a message), SMS functionality, automated calls, and more.

The use of webhooks in X4 Remote is free. However, keep in mind that the external application(s), that you connect to via a webhook, may not be.

What is a webhook?

A webhook is a way for an application to provide external applications with real-time information. It’s sometimes referred to as “reverse API“, because the external application is not requesting the information itself, but is simply being given the information instead. It then needs to be able to interpret this information, because it’s being provided in a certain format. More details on this later.

What can I send?

All messages that you receive in your Lenze message center can be forwarded via a webhook, in real-time. This includes:

  • When a device from your company is transferred to another company.
  • When any Cloud Notify alarm has been triggered.

Add webhook in X4 Remote

Now that you understand what a webhook is and which information you can send via a webhook, you can add a webhook in X4 Remote using a webhool URL. You can get a webhook URL at the website or service that you want to connect to via webhook (e.g. SIGNL4PagerDuty, Zapier, IFTTT, etc.). On that website you need to follow the appropriate steps to connect via a webhook and it will provide you with a webhook URL.

Please follow the steps described below to add a webhook URL in X4 Remote:

  • Go to the X4 Remote. if you are not already there.
  • Go to Messages  , press on the settings menu .
  • Select [Configure webhooks], then select [Add a new webhook]
  •  Enter the name and URL of the Webhook you want to add, then press [Confirm].    

Information format

X4 Remote sends the information in a specific format. As external application you can use services that can already interpret this information format (e.g. SIGNL4, PagerDuty, IFTTT), or use an integration service like Zapier to indirectly connect to numerous other services, like Google Sheets. If you’re really tech-savvy you can even develop your own application, in which case the options are endless.

Below is an example of the Cloud Notify alarm format that is sent via a webhook.

{
"alarmRateLimitTill": null,
"companyId": "2618-3223-2434-8430-3278",
"companyName": "Lenze Demo",
"createdOn": "2019-05-10T09:20:58",
"extraInfo": {
"Counter1000Max30": "30",
  "Device ID": "Tskjgsds6poE",
  "Device name": "Alarming machine"
},
"longContent": "Instructions: Your machine entered an alarm state. Please turn the machine off and clear any dirt.",
"shortContent": "Alarm every 30s of Alarming machine was triggered at 5/10/19, 9:20 AM UTC",
"systemLabel": "alarm-medium",
"userId": "8ffgdfsCO4e",
"userName": "Demo user"
}

 Some explanatory details on the above information:

PropertyRemark
createdOnThe timestamp is in ISO 8601 format.
extraInfoThis property contains the value of the variable at the moment the alarm fired – in the example above the variable “Counter1000Max30” had value “30” – and the device name, which often is the project or customer name.
longContentThis is the information that’s entered as “instructions” in the alarm for more information about the alarm situation
shortContentThis is the subject of the message/e-mail
systemLabelThis property indicates the type of message (e.g. “alarm-medium” means a medium priority alarm)