Campaign: Webhook Action: Connect to another Mautic instance

I have two Mautic installs representing 2 different sites: site1.com and site2.com

I’m trying to create a Campaign on site1.com that will send a webhook to site2.com.

On site2.com, I enabled the API, created a user, and turned off CORS.

I’ve tried every configuration I can think of, but whenever the campaign action/webhook fires, I get the error below:

 Last execution error: Client error: `POST https://apiuser:***@site2.comcom/api/contacts/new` resulted in a `401 Unauthorized` response: {"errors":[{"message":"Authorization denied, invalid credentials.","code":401,"type":"access_denied"}]} 

I’m sure I am doing something wrong.

What should the webhook look like in the Campaign Builder to do this? Are there any settings on the receiving Mautic instance I could have wrong?

Hi

Do you have two different installations of mautic running ? And you are trying to pass information from the one instance to the other ?

Firstly it looks like your web hook is not set up correctly, there is no endpoint, and if you are trying to pass this information you will need to send a web hook to the correct endpoint and catch it on the other side. You should look at the Mautic API documentation, TBH I am not sure you can send a web hook to the API, you may need to use something like zapier to do this if you are not to technical, if you are more technical inclined I would suggest using n8n.io. This way you can capture the web hook, process it and use an HTTP request to connect to the Mautic API

Hi,
After enabling basic auth, just refresh the cache with php bin/console cache:clear.
Let me know if it worked.
J

1 Like