Hello,
I see now you can use webhooks in the campaigns. I can see, that you can specify the headers / data for the request FROM mautic, to the webhook endpoint.
I can’t find an option / documentation clarifying whether you can also use the response from the endpoint, further in the campaign.
For example, the campaign triggers a webhook when user submits a form. The campaign webhook calls some external REST API, which will generate a dedicated, time limited gift-code in external application. The API will return JSON with the code and some other data.
Is there any way, to store the response from the API and use it in the campaign (e.g. to send an email / text with the customized gift code?)
The above is just an example, but my question is generally: “Can you send webhook to external api, and store the response data on a lead AND/OR use the response data during campaign execution?”
You can’t save the json response data directly in Mautic. However you can call your own script from the webhook, which would call the external api based in the parameters, understand the result and make an api call to Mautic to submit the result.
I have an email cleaning script working like this.
See this blogpost:
Is there still no solution for this problem/feature? Like requested to either directly use the response of the webhook further down the campaign or at least save the response in an individual contactfield and then use it in an email?
This would help me with many workflows where I use third-party automation tools to workaround this problem.
We have a similar feature developed as a plugin. It adds a new condition to the campaign.
You can then fetch a JSON API and evaluate the response. Based on the response, you can control the campaign flow. E.g. if it rains you can run this part of the campaign, or if there are new blogs available you send out a new email.
The plugin is currently only available with our Mautic hosting at aivie.ch. If there is enough demand for something like this, we can make it available as a plugin.