{"id":42699,"date":"2023-11-15T10:31:00","date_gmt":"2023-11-14T23:31:00","guid":{"rendered":"https:\/\/onesaas.local\/blog\/what-are-webhooks\/"},"modified":"2024-03-27T19:51:07","modified_gmt":"2024-03-27T19:51:07","slug":"what-are-webhooks","status":"publish","type":"blog","link":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/","title":{"rendered":"What is a webhook?"},"content":{"rendered":"\n<p>Put simply, a webhook is a method of communication used in web development and various online services, that is triggered by specific events. Imagine if your application could receive a phone call whenever something noteworthy happens elsewhere on the web. <\/p>\n\n\n\n<p>That&#8217;s exactly what webhooks do. They notify your application instantly when a particular event occurs, prompting it to respond with a specific action.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does a webhook work?<\/h2>\n\n\n\n<p>With a traditional system, your application would have to constantly check or &#8216;poll&#8217; other services for updates. This is not only inefficient, but it also doesn&#8217;t provide real-time updates. Webhooks, on the other hand, reverse this process.&nbsp;<\/p>\n\n\n\n<p>Webhooks rely on HTTP (Hypertext Transfer Protocol) to transmit data. When an event occurs, the sending system requests an HTTP POST to a predefined URL, often called the &#8220;callback URL.&#8221; This URL points to the receiver&#8217;s endpoint, where it expects to receive data.<\/p>\n\n\n\n<p>Basically, when a specific event happens, the data related to the event are sent immediately to a URL designated by your application. This automated information exchange allows web applications to communicate with each other in real time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What are some common use cases?<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Real-time updates. <\/strong>Social media platforms use webhooks to instantly notify users of new messages, likes, or comments.<\/li>\n\n\n\n<li><strong>Ecommerce.<\/strong> Online stores employ webhooks to update inventory levels, process orders, and send order status notifications.<\/li>\n\n\n\n<li><strong>Notifications.<\/strong> Messaging apps use webhooks to deliver real-time notifications, such as chat messages or friend requests.<\/li>\n\n\n\n<li><strong>IoT (Internet of Things)<\/strong>. Webhooks are essential for collecting sensor data from IoT devices and triggering actions based on sensor readings.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up webhooks.<\/h2>\n\n\n\n<p>Setting up webhooks involves three primary steps:&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a webhook endpoint.<\/strong> This is a URL in your application that will receive the webhooks. It should be an <a href=\"https:\/\/messagemedia.com\/nz\/sms-api-gateway\/\">API<\/a> endpoint that is capable of processing POST requests, as POST is the HTTP method generally used by webhooks.<\/li>\n\n\n\n<li><strong>Register the webhook endpoint with the provider.<\/strong> The webhook provider needs to know where to send the webhooks. This usually involves going to the provider&#8217;s dashboard or settings page and adding your endpoint URL to the webhooks section. You might also need to specify which events you want to subscribe to.<\/li>\n\n\n\n<li><strong>Implement the logic for received webhooks.<\/strong> Once your application receives a webhook, it needs to know what to do with the data. This could be anything from updating a user&#8217;s email address to processing a payment. The logic you implement will depend entirely on your application&#8217;s specific needs.<\/li>\n<\/ol>\n\n\n\n<p>Remember to secure your webhooks to ensure that incoming requests are indeed from the provider. This usually involves verifying signatures that webhook providers include in their requests.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to use webhooks with SMS.<\/h2>\n\n\n\n<p>Using webhooks with SMS is a powerful way to integrate real-time communication into your applications. To get started, you&#8217;ll need to sign up with an SMS service provider that supports webhooks, like Sinch MessageMedia.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>First, set up a webhook endpoint on your server to receive incoming SMS data.<\/li>\n\n\n\n<li>Once your webhook is in place, configure your SMS service provider to send a webhook notification whenever a new SMS is received. This notification will typically include essential information such as the sender&#8217;s phone number, the message content, and a timestamp.<\/li>\n\n\n\n<li>You can then process this data in real-time, enabling various actions like automated replies, storing message history, or triggering specific events based on incoming SMS content.<\/li>\n<\/ol>\n\n\n\n<p>By using webhooks with SMS, you can create dynamic, interactive, and responsive SMS-based applications that enhance your communication capabilities.<\/p>\n","protected":false},"author":1,"featured_media":36565,"menu_order":227,"template":"","meta":{"_acf_changed":false,"popular":false,"coming_soon":false,"link":"","footnotes":""},"blog_category":[127],"class_list":["post-42699","blog","type-blog","status-publish","has-post-thumbnail","hentry","blog_category-developers-nz"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Is A Webhook? | Sinch MessageMedia New Zealand<\/title>\n<meta name=\"description\" content=\"Let&#039;s chat all things webhooks. Learn what they are, how they work, and how to set them up for real-time data communication. New Zealand\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is A Webhook? | Sinch MessageMedia\" \/>\n<meta property=\"og:description\" content=\"Let&#039;s chat all things webhooks. Learn what they are, how they work, and how to set them up for real-time data communication.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/\" \/>\n<meta property=\"og:site_name\" content=\"Sinch MessageMedia\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-27T19:51:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/07\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"325\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/\",\"name\":\"What Is A Webhook? | Sinch MessageMedia\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg\",\"datePublished\":\"2023-11-14T23:31:00+00:00\",\"dateModified\":\"2024-03-27T19:51:07+00:00\",\"description\":\"Let's chat all things webhooks. Learn what they are, how they work, and how to set them up for real-time data communication.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/#breadcrumb\"},\"inLanguage\":\"en-NZ\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NZ\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/#primaryimage\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg\",\"contentUrl\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg\",\"width\":1024,\"height\":325,\"caption\":\"chris ried 512801 unsplash scaled e1591850657622\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/blog\\\/what-are-webhooks\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/messagemedia.com\\\/nz\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/messagemedia.com\\\/us\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What is a webhook?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#website\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/\",\"name\":\"Sinch MessageMedia\",\"description\":\"Business SMS &amp; Messaging Platform\",\"publisher\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-NZ\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#organization\",\"name\":\"Sinch MessageMedia\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NZ\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-mm-sinch.svg\",\"contentUrl\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-mm-sinch.svg\",\"width\":1,\"height\":1,\"caption\":\"Sinch MessageMedia\"},\"image\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is A Webhook? | Sinch MessageMedia New Zealand","description":"Let's chat all things webhooks. Learn what they are, how they work, and how to set them up for real-time data communication. New Zealand","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/","og_locale":"en_US","og_type":"article","og_title":"What Is A Webhook? | Sinch MessageMedia","og_description":"Let's chat all things webhooks. Learn what they are, how they work, and how to set them up for real-time data communication.","og_url":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/","og_site_name":"Sinch MessageMedia","article_modified_time":"2024-03-27T19:51:07+00:00","og_image":[{"width":1024,"height":325,"url":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/07\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/","url":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/","name":"What Is A Webhook? | Sinch MessageMedia","isPartOf":{"@id":"https:\/\/messagemedia.com\/au\/#website"},"primaryImageOfPage":{"@id":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/#primaryimage"},"image":{"@id":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/#primaryimage"},"thumbnailUrl":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/07\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg","datePublished":"2023-11-14T23:31:00+00:00","dateModified":"2024-03-27T19:51:07+00:00","description":"Let's chat all things webhooks. Learn what they are, how they work, and how to set them up for real-time data communication.","breadcrumb":{"@id":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/#breadcrumb"},"inLanguage":"en-NZ","potentialAction":[{"@type":"ReadAction","target":["https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/"]}]},{"@type":"ImageObject","inLanguage":"en-NZ","@id":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/#primaryimage","url":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/07\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg","contentUrl":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/07\/chris-ried-512801-unsplash-scaled-e1591850657622.jpg","width":1024,"height":325,"caption":"chris ried 512801 unsplash scaled e1591850657622"},{"@type":"BreadcrumbList","@id":"https:\/\/messagemedia.com\/nz\/blog\/what-are-webhooks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/messagemedia.com\/nz\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/messagemedia.com\/us\/blog\/"},{"@type":"ListItem","position":3,"name":"What is a webhook?"}]},{"@type":"WebSite","@id":"https:\/\/messagemedia.com\/au\/#website","url":"https:\/\/messagemedia.com\/au\/","name":"Sinch MessageMedia","description":"Business SMS &amp; Messaging Platform","publisher":{"@id":"https:\/\/messagemedia.com\/au\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/messagemedia.com\/au\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-NZ"},{"@type":"Organization","@id":"https:\/\/messagemedia.com\/au\/#organization","name":"Sinch MessageMedia","url":"https:\/\/messagemedia.com\/au\/","logo":{"@type":"ImageObject","inLanguage":"en-NZ","@id":"https:\/\/messagemedia.com\/au\/#\/schema\/logo\/image\/","url":"https:\/\/messagemedia.com\/wp-content\/uploads\/2024\/03\/logo-mm-sinch.svg","contentUrl":"https:\/\/messagemedia.com\/wp-content\/uploads\/2024\/03\/logo-mm-sinch.svg","width":1,"height":1,"caption":"Sinch MessageMedia"},"image":{"@id":"https:\/\/messagemedia.com\/au\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/blog\/42699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/blog\/42699\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/media\/36565"}],"wp:attachment":[{"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/media?parent=42699"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/messagemedia.com\/nz\/wp-json\/wp\/v2\/blog_category?post=42699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}