This manual will demonstrate you on how to set up a direct connection between the Uninstall plugin action (to receive data) and your chosen service (to send data to this action).
To get started, we will walk you through each step from the beginning to the end so that you can make sure your endpoint will work as expected.
Required plugins/services
In order to use this webhook action within a direct connection, you need to make sure you installed and activated the following plugins, and/or have a valid account with the given service:
1. Setup WP Webhooks
To get started with WP Webhooks, simply download the latest version from your account dashboard and install/activate it on your WordPress website. If you want to lean more about the installation process of the plugin itself, please check out this manual.
2. Integrate the action with your service
In order to send data from your service to the Uninstall plugin action, you need to provide an URL to your service so that it can send information over to WP Webhooks.
As we provide automatically such receiving webhook URLs, you can simply copy it from within WP Webhooks.
- Please head over to your WordPress dashboard > WP Webhooks > Receive Data > Uninstall plugin and create/copy a webhook URL of your choice.
- Once you copied the URL, please locate the possibility to send data within your external service (this could be a webhook endpoint, API integration, etc.), or an automation service such as Zapier, Make (Integromat), Zoho Flows, n8n, etc (Click here to see a list of all available third-party integrations).
- After that, you can add the copied URL from the "Receive Data" tab into the specified field of your service.
What we have accomplished so far: At this stage, your external service is already able to send data to your WordPress website via the previously generated URL. By default, our plugin can detect (and accepts) various Content-Types such as JSON and XML. We also suggest sending the requests as a POST request.
3. Set up Data Mapping
While the above connection can aleady transer data from your service to the Uninstall plugin action, it won't do much as in most cases the data sent from your service has a different format than what WP Webhooks requires.
To solve that, we offer a feature called Data Mapping. This allows you to automatically alter and map the incoming data from your service to map its values to the required arguments from WP Webhooks.
This feature allows you to do various mapping possibilities, create new values and manipulate existing ones. To show you this feature in a practical way, down below is a short manual on how you can set up the data mapping template:
Set up a Data Mapping template
- Go to your WordPress dashboard > Settings > WP Webhooks > Data Mapping and add a new Data Mapping template.
- Within it, you can add your mapping data that adjusts the data sent by your service to the arguments required by WP Webhooks.
- Lastly, you need to connect the Data Mapping template to the receiving URL you selected in step 1 (Setup your Webhooks). To do that, please head over to your WordPress dashboard > WP Webhooks > Receive Data and open the Setting of the specific webhook URL. There you will find a setting called Add request data mapping template - simply select your your Data Mapping template from the dropdown and save it.
- That's it. Now all data sent from your service will be validated by the data mapping template. To learn more about it, please check out our documentation for Data Mapping templates.
Configure the Data Mapping template
Now it is up to you what data you want to send in wich way to the Uninstall plugin action. As for most of our actions, we offer something called Arguments which are similar to variables that you can use to assign data to a purpose.
Below this box you will find a list of all available action arguments for the Uninstall plugin action. Click here to jump direclty to it.
- Go to your WordPress dashboard > WP Webhooks > Data Mapping and open the data mapping template you created in the previous step.
- Within it, you can create your mapping based on the arguments from the argument list. Once you add a new row, you can add the argument into the left field.
- On the right you can add keys to map the data based on the data that was sent by your service. To learn more about the mapping, please check out this helpfile.
- Down below you will find a data mapping template example that shows a simple configuration on how to use it to manipulate values.
{"template_settings":{"wpwhpro_data_mapping_whitelist_payload":"none"},"template_data":[{"new_key":"static_first_name","singles":["{\"settings\":{\"wpwhpro_data_mapping_value_type\":\"data_value\",\"wpwhpro_data_mapping_convert_data\":\"none\",\"wpwhpro_data_mapping_decode_data\":\"none\",\"wpwhpro_data_mapping_fallback_value\":\"\"},\"value\":\"Jon\"}"]},{"new_key":"static_last_name","singles":["{\"settings\":{\"wpwhpro_data_mapping_value_type\":\"data_value\",\"wpwhpro_data_mapping_convert_data\":\"none\",\"wpwhpro_data_mapping_decode_data\":\"none\",\"wpwhpro_data_mapping_fallback_value\":\"\"},\"value\":\"Doe\"}"]},{"new_key":"full_name","singles":["{\"settings\":{\"wpwhpro_data_mapping_value_type\":\"data_value\",\"wpwhpro_data_mapping_convert_data\":\"none\",\"wpwhpro_data_mapping_decode_data\":\"none\",\"wpwhpro_data_mapping_fallback_value\":\"\"},\"value\":\"{:static_first_name:} {:static_last_name:}\"}"]},{"new_key":"mapped_first_name","singles":["{\"settings\":{\"wpwhpro_data_mapping_value_type\":\"key_mapping\",\"wpwhpro_data_mapping_convert_data\":\"none\",\"wpwhpro_data_mapping_decode_data\":\"none\",\"wpwhpro_data_mapping_fallback_value\":\"\"},\"value\":\"static_first_name\"}"]}]}
- After the import, simply save the template. From there, you can head over to the preview (via the Preview template button) and see how the data mapping template is adjusting the data from the left side (which is the incoming data) to the mapped data (on the right).
- Lastly, you only need to map the values sent by your service to the arguments available for this action.
If you are unsure about the format the data is sent from your service, you have various options:- One possibility is to check the documentation of your service as they often document their payloads
- If your payload is not documented, you can also use our Log feature. Once you sent a request from your service to the webhook URL, you will see an entry within the logs, including the data.
- You can also send the data to a different webhook URL such as the one generated by https://webhook.site/.
4. Summary
If you followed the steps above, you successfully set up your webhook connection and connected the data mapping template. This is everything you need to automatically send data from your external service to the Uninstall plugin action.
In case you want to learn more about this setup and others, please visit our documentation.