Webhooks allows your application to receive real-time notifications of messaging events that occur on the MessageMedia platform.
When your application sends a message via MessageMedia’s API, the message is delivered (or rejected for whatever reason) and, at some point after that, the recipient replies. When this happens your application must be able to respond to events that happen via a notification channel. Within modern applications, the notification channel is a webhook. Webhooks allow your application to subscribe to receive notifications when a certain event occurs – such as when a customer replies to a message.
Using a common example, if you message a customer asking them to confirm their attendance at an appointment, you send them a message via the MessageMedia API. The customer responds with a confirmation or cancellation message. When this confirmation or cancellation message is received by the MessageMedia platform, a webhook will notify your application of this event. This notification will contain all the data required by your application to take appropriate action, including the text of the user’s reply and their phone number.
Without webhooks, developers would have to poll the MessageMedia API by sending the same request repeatedly to check if the customer had replied. This is inefficient and introduces unnecessary latency, that is, the time between each request to check for new messages. Webhooks are only triggered when an event has occurred and occur in real time, so there’s not latency and your application immediately receives the reply message from the end user.
Webhooks are the unsung heroes of the modern internet. APIs allow applications to make requests to each other, while webhooks allow applications to notify each other, in real time, of important events.
Webhooks have enabled developers to build rich applications on top of powerful platforms, such as JIRA and eBay. For example, eBay provides its own set of useful webhooks to perform certain tasks, such as inform you when a product is updated, an order is paid or a refund is initiated. Developers can use this to build applications that integrate directly with eBay. JIRA uses webhooks to notify your app or web application when certain events occur in JIRA, like an update to an issue.