Trigger actions from webhooks with no code
Introduction
If you're looking to trigger some actions from the IAPHUB webhooks but you either have no server or you only need to do something simple, some services can help you do just that.
Integromat, Zapier, IFTT (and many more) are services that can listen to the webhooks sent by IAPHUB and trigger actions (such as sending a mail). You can easily develop some complex tasks with their editor, no code required.
Example using Integromat
Let's create a small task using Integromat, their free plan offers 1000 operations/month.
We are going to send an email automatically when the subscription of a user expire.
First create a new 'scenario' and add the webhooks service.
Select Custom webhook, click on 'Add' and give your webhook a name.
An URL should appear, copy/paste this URL in the settings of your IAPHUB app.
After you've added the Integromat URL in the webhooks settings of your app, Integromat should tell you when the webhook has been received successfully.
Click on 'OK' to close the window and click on 'Webhooks' again.
Click on the button Re-determine the data structure, we need to send the webhook of a purchase in order to help Integromat to determine the JSON payload of the webhook. In order to do so simply make a new purchase in sandbox.
After you're done configuring the webhooks, click on Add another module (small bubble) and select Email. Select the action Send me an email.
You should be able to type a Subject and a Content with the possibility to use the data from the webhooks.
Now we only need to add a filter in order to only send an email when a subscription expire.
In order to do so click on the icon between the two bubbles and click on Setup a filter.
Give your filter a label and add a condition that the property 'type' must equal 'subscription_expire'.
Congratulations! Everything is now set up correctly!
If you make a purchase is sandbox and wait for the subscription to expire, an email will be sent to your mailbox.
You can also use a service such as Postman in order to send a fake webhook to Integromat for testing purposes.