Answers.Body: <p>This is nitech from the future. You need to read up a bit. While you built RC Planes from FliteTest with your kids, I went ahead and read up a bit for you: </p>
  
  <p><strong>Webhooks is a concept, not a technology</strong> </p>
  
  <p><a href="https://en.wikipedia.org/wiki/Webhook" rel="noreferrer">Webhooks</a> are to apps what push notifications are to us. Remember when you had to check your email to know if there was a new mail? Not any more. Technically speaking, webhooks are <a href="https://zapier.com/blog/what-are-webhooks/" rel="noreferrer">"user-defined callbacks made with HTTP"</a>. They are usually triggered by some event happening in the source app. </p>
  
  <p>Nitech, you're familiar with HTTP-requests, right? It's kinda the way the web it built. A webhook is simply a POST request typically containing JSON, like this one, coming from your ERP-system: </p>
  
  <pre><code>{
    "sku" : "JU40000365",
    "price" : "29999",
    "stock" : "9"
  }
  </code></pre>
  
  <p>It says: Product with SKU JU40000365 has changes - and they're included in the JSON. </p>
  
  <p><strong>The power of Webhooks is that they're triggered by the source app</strong></p>
  
  <p>Okay, I made that one up. But that's my understanding anyhow. The source detects a change - through whatever mechanism (event, polling, whatever), and triggers a webhook, if there is a webhook configured for that change. </p>
  
  <p>It's the way PayPal tells your shop that the purchase of order 123 was successfully paid - or declined. </p>
  
  <p><strong>How to accept incoming webhooks</strong></p>
  
  <p>So, back to your question - atm. you have to create a plugin or module for Craft CMS in order to handle incoming Webhooks. </p>
  
  <p>If you have a look at <a href="https://github.com/riasvdv/craft-stripe-webhooks/tree/master/src" rel="noreferrer">Rias' Stripe Webhook Plugin for Craft</a>, you can easily build your own plugin for your specific purpose. Look specifically at <a href="https://github.com/riasvdv/craft-stripe-webhooks/blob/master/src/controllers/DefaultController.php" rel="noreferrer">the controller</a>. </p>
  
  <p>Also have a look at the Craft 3 documentation, <a href="https://docs.craftcms.com/v3/extend/plugin-guide.html" rel="noreferrer">How to build a plugin</a>, which gives you what you need to scaffold and load a plugin into your Craft CMS repo.</p>
  
  <p>I used <a href="https://pluginfactory.io/" rel="noreferrer">pluginfactory.io</a> to create a scaffold for the plugin. </p>
  
  <p>In finishing, you may ask why I can't simply just give you a zip-file with the finished plugin. My answer is that you'll be better off experimenting and learning this yourself.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-07T10:59:55.663Z
Answers.Text: Agh. It's nitech from even further into the future. I had forgotten this answer and was led back by Google. Hope this two way integration comes to fruition now - and it's amazing what we (at least I) forget once a few years have passed.
Answers.UserDisplayName: nitech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T16:53:09.020Z
Answers.Text: from the future is amazing! :)
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T16:57:25.717Z
Answers.Text: Yes, he is. If only I knew what he knows...
Answers.UserDisplayName: nitech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T08:25:04.380Z
Answers.LastActivityDate: 2019-11-13T11:23:36.953Z
Answers.LastEditDate: 2019-11-13T11:23:36.953Z
Answers.UserDisplayName: nitech
Body: <p>I've tested the <a href="https://plugins.craftcms.com/webhooks" rel="nofollow noreferrer">webhooks plugin</a>. Awesome. Works brilliantly. </p>
  
  <p>How how about incoming webhooks? What if my 3rd party ERP system has changes that it wants to put into my Craft site. How do I go about getting the changes into Craft?</p>
  
Tags: <api><plugin-webhooks>
Title: How to accept incoming webhooks?
ThreadText: # How to accept incoming webhooks?
  
  (Asked by: username_0 on 2019-11-11)
  
  I've tested the [webhooks plugin](https://plugins.craftcms.com/webhooks). Awesome. Works brilliantly.
  
  How how about incoming webhooks? What if my 3rd party ERP system has changes that it wants to put into my Craft site. How do I go about getting the changes into Craft?
  
  **Tags:** api, plugin-webhooks
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-11-13. Score: 7 | Accepted answer
  
  This is username_0 from the future. You need to read up a bit. While you built RC Planes from FliteTest with your kids, I went ahead and read up a bit for you:
  
  **Webhooks is a concept, not a technology**
  
  [Webhooks](https://en.wikipedia.org/wiki/Webhook) are to apps what push notifications are to us. Remember when you had to check your email to know if there was a new mail? Not any more. Technically speaking, webhooks are ["user-defined callbacks made with HTTP"](https://zapier.com/blog/what-are-webhooks/). They are usually triggered by some event happening in the source app.
  
  username_0, you're familiar with HTTP-requests, right? It's kinda the way the web it built. A webhook is simply a POST request typically containing JSON, like this one, coming from your ERP-system:
  
  ```
  {
    "sku" : "JU40000365",
    "price" : "29999",
    "stock" : "9"
  }
  
  ```
  
  It says: Product with SKU JU40000365 has changes - and they're included in the JSON.
  
  **The power of Webhooks is that they're triggered by the source app**
  
  Okay, I made that one up. But that's my understanding anyhow. The source detects a change - through whatever mechanism (event, polling, whatever), and triggers a webhook, if there is a webhook configured for that change.
  
  It's the way PayPal tells your shop that the purchase of order 123 was successfully paid - or declined.
  
  **How to accept incoming webhooks**
  
  So, back to your question - atm. you have to create a plugin or module for Craft CMS in order to handle incoming Webhooks.
  
  If you have a look at [Rias' Stripe Webhook Plugin for Craft](https://github.com/riasvdv/craft-stripe-webhooks/tree/master/src), you can easily build your own plugin for your specific purpose. Look specifically at [the controller](https://github.com/riasvdv/craft-stripe-webhooks/blob/master/src/controllers/DefaultController.php).
  
  Also have a look at the Craft 3 documentation, [How to build a plugin](https://docs.craftcms.com/v3/extend/plugin-guide.html), which gives you what you need to scaffold and load a plugin into your Craft CMS repo.
  
  I used [pluginfactory.io](https://pluginfactory.io/) to create a scaffold for the plugin.
  
  In finishing, you may ask why I can't simply just give you a zip-file with the finished plugin. My answer is that you'll be better off experimenting and learning this yourself.
  
  > **Comments:**
  > **username_1**: from the future is amazing! :)  
  > **username_0**: Yes, he is. If only I knew what he knows...  
  > **username_0**: Agh. It's username_0 from even further into the future. I had forgotten this answer and was led back by Google. Hope this two way integration comes to fruition now - and it's amazing what we (at least I) forget once a few years have passed.  
  
  ---
  
  