Mautic campaign Webhooks

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?”

thanks!

I’m curious about this same exact thing. Would love to know if anyone knows if you can do this!

I also wanted to know if the webhook can take JSON data? Unable to get it to work

We are also interested to see if this issue is resolved! :pray:

You can probably do some processing by subscribing to some of the events that are here:

However I did not try it (yet), but based on how mautic works and how code is structured, this is where I would start.

1 Like

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.

Most marketers solve this problem other ways:

  1. Creating a plugin to communicate with outside systems
  2. Using middleware like make.com or n8n.com. Both offer super-flexible ways to solve this.

Alteratively you can pay a developer to code this, please post it in the forums under commercial.

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.

1 Like

interested!
:slight_smile:

Looking forward to this.