Nested array of objects in webhook data

Hi,

I’m trying to send a webhook as a campaign event but the requested format does not work:

Format requested: Send Template Message

{
    "broadcast_name": "welcome_test",
    "parameters": [
        {
            "name": "name",
            "value": "Marc"
        }
    ],
    "template_name": "berlin_welcome_test"
}

Mautic only sends:

{
    "broadcast_name":"welcome_test",
    "parameters":"[{\"name\":\"name\",\"value\":\"Marc\"}]",
    "template_name":"berlin_welcome_test"
}

So the nested array of parameters gets an extra quote.

How can i solve this?

1 Like

Hi, I have the same problem. Did you solve this?

Thanks and best regards

this seem to be a shortfall of mautic, the way I worked around it was to create a middle man, that receives the mautic webhook and converts the data so the final destination can read it. n8n seem a good open source tool to do such thing, there is also paid services like integromat.

for my case in particular, as a developer, I use serverless functions (also known as lambda functions in AWS). Netlify (Netlify Functions) allows you to host those function up to 125k monthly function calls for free, cloudflare as a similar service as well

Hi, thanks for your reply. I’m a developer too and i’ll try to edit php file used for webhook or i’ll create a php file on one of my server to process data received and forward them to the final destination

i’m trying to send whatsapp messages via api and for template section i need to write an array like this

template: {
     name: hello_world,
     language: {
          code: it_IT
          }
}

i just opened this thread Webhook campaign action: send array values

Today I wrote the php code that forwards Mautic webhook to Facebook API.

In this way we must not use twilio or any other third party service to send

This is the workflow:

We must upload a PHP file everywhere over the internet. It can be uploaded on the same server where mautic is installed or into another domain.

We must send webhook to this file that will elaborate the payload and will forward it to WhatsApp.

Tomorrow I’ll post a new thread with details about webhook in mautic campaign and also the php file that forwards data to WhatsApp.

is this issue solve? Please help