The Send data to Webhook action is a powerful action that enables your WordPress site to integrate with any number of other systems and services that support receiving data via webhooks, such as IFTTT, Integromat, or another site running Uncanny Automator. (For Zapier, see Zapier Actions.)
Setting up a webhook action
- Create your new Automator recipe and add Send data to webhook as an action. You can find it under Webhooks > Send data to webhook.
- Click the webhook box in the action to set the webhook parameters.
- In the URL field, paste the webhook’s target URL. You will need to get this URL from the system/service you are using to receive the data.
- If you know what Request method your receiving service requires, select it from the dropdown. Otherwise, leave this as default (POST).
- If you know what Data format your receiving service requires, select it from the dropdown. Otherwise, leave this as default (x-www-form-urlencoded).
- If you know what Headers your receiving service requires, add them as Key and Value pairs. Otherwise, leave this as default.
- If you want to pass data from WordPress to your receiving service, enter match Key and Value fields in the Body section. Think of a Key as a label for the value.
- Enter a text label in the Key field first.
- For Values, you will probably want to pass in dynamic data related to the user and WordPress environment. To choose variables, click the * symbol to the right of the value. You’ll see drop-down lists for common tokens as well as tokens related to the triggers in the recipe. An example of a common token is the user’s name, as it can be used in any recipe; a recipe token might be the name of a course associated with a course completion trigger. Choose a token to include by clicking it. You’ll see something like “{{user_firstname}}”. Make sure that you do not make any changes to the token format.
- If you want to pass nested data from WordPress to your receiving service, enter Keys as a parent/child pair, separated by forward-slash / in the Body section. You will also have to change the Data format from x-www-form-urlencoded to JSON.
- If you want to preview your outgoing data, click Check data format.
- If you want to send a test webhook, click Send test.
- Save the action. Now switch the action from Draft to Live. Don’t forget to set your triggers and the recipe to live as well.
And that’s it! You now have a recipe that sends a webhook from your WordPress site, based on a user’s actions.
Please note that to pass webhook data security and without issue, it’s important that your WordPress site be properly security with a valid SSL certificate.