Difference between revisions of "Webhooks"

From Evil Mad Scientist Wiki
Jump to: navigation, search
(Create outline)
(No difference)

Revision as of 21:16, 9 January 2022

  This wiki page is part of our AxiDraw documentation

Please click here to return to the AxiDraw overview.

Overview: Using Webhooks with AxiDraw

The AxiDraw software, starting with version 3.1, is capable of posting a Webhook (HTTP callback) to a specified URL at the end of a plot. This provides an optional method, in combination with various third-party services, for generating notifications such as mobile alerts or email when the AxiDraw finishes. It can also be used for custom integration with other software or hardware, to trigger other actions that should follow a plot.

This feature is available in the main Inkscape-based software as well as the AxiDraw CLI and AxiDraw Python module APIs.

Data posted

Services

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, IFTTT and Integromat, offer free tiers that support webhooks. Paid services that support webhooks include Zapier and Automate.io.


DIY webhooks

Setting up mobile notifications with IFTTT

As a example,

1. Create a free account at IFTTT.com. Optionally, 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”.

4. On the next screen, “Choose a service,” type “webhooks” in the search box. Then, click the Webhooks button to select it.

5. On the next screen, “Choose a trigger”, select “Receive a web request”.

6. The next screen, “Complete trigger fields”, asks for an Event Name. Give it a name, maybe “axidraw_done”, then click the Create Trigger.

7. Click the Add button next to “Then That”.

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.

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 Template:Value3 finished document Template:Value1 in Template:Value2.” Click the Create Action button to finish adding it. Then click Continue to review.

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; shown circled here, and then click the Documentation button.

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:

        https://maker.ifttt.com/trigger/axidraw_done/with/key/PRIVATE_KEY

13. Copy and paste the URL into the Webhook URL field of Axidraw Control.