Editing Webhooks

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 9: Line 9:
 
=== Third-party services ===
 
=== Third-party services ===
  
Various internet services exist, both free and paid, that allow one to trigger different actions upon receipt of a webhook post. Common services [http://ifttt.com IFTTT] and [http://integromat.com Integromat], offer tiers that support webhooks and do (or did) support doing so on the free service tier.. Similar, paid, services that support webhooks include Zapier and Automate.io. Any of these services provides an interface to receive webhooks without requiring coding.
+
Various internet services exist, both free and paid, that allow one to trigger different actions upon receipt of a webhook post. Two services that we are aware of, [http://ifttt.com IFTTT] and [http://integromat.com Integromat], offer free tiers that support webhooks. Similar, paid, services that support webhooks include Zapier and Automate.io. Any of these services provides an interface to receive webhooks without requiring coding.
  
[https://ntfy.sh/ ntfy] is a newer service that supports mobile notifications on iOS and Android devices. It's a free (and open source) service where you don't even need to create an account.  
+
 
 +
=== DIY; working without third-party services ===
 +
 
 +
For custom integrations, it may be helpful to listen for and receive a webhooks with your own software. Webhooks are small-scale HTTP posts to a given URL and it is relatively straightforward (as far as these things go) to deploy a small web server for that purpose. A good article with some starting points is avaialable at [https://hackernoon.com/how-to-listen-for-webhooks-using-python-7g153uad hackernoon] for python and [https://medium.com/@BearerSH/consuming-webhooks-with-node-js-and-express-50e007fc7ae2 the Bearer blog] for node.js.
  
  
Line 18: Line 21:
 
Webhook alerts are only generated when a plot ends, by completion or being paused, and all four of the following conditions are met:
 
Webhook alerts are only generated when a plot ends, by completion or being paused, and all four of the following conditions are met:
  
:1. A document is being plotted with the Plot, Layers, or Resume tab (or a corresponding API mode),
+
:1. Webhooks are enabled, for example by the checkbox in the Preview & Alerts tab of AxiDraw Control
  
:2. The document is being physically plotted, with preview mode disabled,
+
:2. A document is being plotted with the Plot, Layers, or Resume tab, and
  
:3. Webhooks are enabled, for example by the checkbox in the Preview & Alerts tab of AxiDraw Control, and
+
:3. The document is being physically plotted, with preview mode disabled, and
  
:4. A Webhook URL is provided
+
:4 A Webhook URL is provided
  
In all other case, when any of the above conditions are not met, the Webhook is not posted.
+
In any other case, the Webhook is not posted.
  
  
=== Some technical details ===
+
=== Data posted ===
 
 
==== DIY; working without third-party services ====
 
 
 
For custom integrations, it may be helpful to listen for and receive a webhooks with your own software. Webhooks are small-scale HTTP posts to a given URL and it is relatively straightforward (as far as these things go) to deploy a small web server for that purpose. A good article with some starting points is avaialable at [https://hackernoon.com/how-to-listen-for-webhooks-using-python-7g153uad hackernoon] for python and [https://medium.com/@BearerSH/consuming-webhooks-with-node-js-and-express-50e007fc7ae2 the Bearer blog] for node.js. 
 
 
 
 
 
==== Data posted ====
 
  
 
When the AxiDraw finishes a plot and webhooks are enabled, the software will send data by the HTTP POST method to to the URL that you specify.  
 
When the AxiDraw finishes a plot and webhooks are enabled, the software will send data by the HTTP POST method to to the URL that you specify.  
Line 50: Line 46:
 
Here, in some detail, is how to set up app-based mobile notifications using the IFTTT service. Slight variations on this can be used to select other actions once the webhook is received by IFTTT.  
 
Here, in some detail, is how to set up app-based mobile notifications using the IFTTT service. Slight variations on this can be used to select other actions once the webhook is received by IFTTT.  
  
'''1.''' Create a free account at [http://ifttt.com IFTTT.com]. For mobile alerts, install their mobile app as well.
+
1. Create a free account at [http://ifttt.com IFTTT.com]. For mobile alerts, install their mobile app as well.
 
 
'''2.''' Click the '''Create''' button to begin creation of an “applet”.
 
  
'''3.''' Click the '''Add''' button next to “If This”.
+
2. Click the Create button to begin creation of an “applet”.
  
'''4.''' On the next screen, “Choose a service,” type “webhooks” in the search box. Then, click the Webhooks service to select it.
+
3. Click the Add button next to “If This”.
  
'''5.''' On the next screen, “Choose a trigger”, select “Receive a web request”.
+
4. On the next screen, “Choose a service,” type “webhooks” in the search box. Then, click the Webhooks button to select it.
  
'''6.''' The next screen, “Complete trigger fields”, asks for an Event Name. Give it a name, maybe “axidraw_done”, then click '''Create Trigger'''.
+
5. On the next screen, “Choose a trigger”, select “Receive a web request”.
  
'''7.''' Click the '''Add''' button next to “Then That”.
+
6. The next screen, “Complete trigger fields”, asks for an Event Name. Give it a name, maybe “axidraw_done”, then click the Create Trigger.
  
'''8.''' Select and configure an action to trigger when a plot completes. We recommend the “Notifications” service, which gives mobile notifications from the IFTTT app, on Android or iOS. If using Notifications, choose the basic “Send a notification from the IFTTT app” option.
+
7. Click the Add button next to “Then That”.
  
'''9.''' Complete the “action fields” for the action that you have selected. For Notifications, the text can be as simple as “Plot done”, or if you would like to use the data fields, as complex as
+
8. Select and configure an action to trigger when a plot completes. We recommend the “Notifications” service, which gives mobile notifications from the IFTTT app, on Android or iOS. If using Notifications, choose the basic “Send a notification from the IFTTT app” option.
<pre>AxiDraw {{Value3}} finished document {{Value1}} in {{Value2}}.</pre>
 
  
Click the '''Create Action''' button to finish adding it. Then click '''Continue''' to review.
+
9. Complete the “action fields” for the action that you have selected. For Notifications, the text can be as simple as “Plot done”, or using data fields, as complex as “AxiDraw {{Value3}} finished document {{Value1}} in {{Value2}}.”
 +
Click the Create Action button to finish adding it. Then click Continue to review.
  
'''10.''' Optionally rename the applet; click '''Finish''' to complete.
+
10. Optionally rename the applet; click Finish to complete.
  
'''11.''' The completed applet should be displayed similar to here, with a brief summary of its settings. Click the “webhook” symbol on the applet; (a somewhat triangular shape with circular corners), and then click the '''Documentation''' button.
+
11. The completed applet should be displayed similar to here, with a brief summary of its settings. Click the “webhook” symbol on the applet; shown circled here, and then click the Documentation button.
  
'''12.''' On this page is the webhook URL.
+
12. On this page is the webhook URL.
  
 
Fill in the {event} placeholder with your Event Name (“axidraw_done”, in our example) to get the final URL. The webhook URL typically looks like:
 
Fill in the {event} placeholder with your Event Name (“axidraw_done”, in our example) to get the final URL. The webhook URL typically looks like:
 
         <code>https://maker.ifttt.com/trigger/axidraw_done/with/key/PRIVATE_KEY</code>
 
         <code>https://maker.ifttt.com/trigger/axidraw_done/with/key/PRIVATE_KEY</code>
  
'''13.''' Copy and paste the full URL into the '''Webhook URL''' field in the Preview & Alerts tab of Axidraw Control.
+
13.  Copy and paste the full URL into the Webhook URL field of Axidraw Control.

Please note that all contributions to Evil Mad Scientist Wiki are considered to be released under the GNU Free Documentation License 1.3 (see Evil Mad Scientist Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Template used on this page: