Campaigne webhook with company custom field is empty

My Mautic version is: v 4.4.9
My PHP version is: 8.0.26
My Database type and version is: mariaDB 5.7.35-38

My problem is:
Hey, im new to mautic and i have a problem with a campaign webhook.

I created a custom field for companys( IDF-number and U-ID).

In the campaign i send a POST webhook with contact data and company data to an external API. In this test case to webhook.site.

The contact is associated with a primary company ( from which i would like to send the custom fields to the API).

However all contact data is send successfully expect the company custom fields. The response is empty.
result

Do i miss something here? I use {contactfield=uid} (uid is the alias for custom field U-ID) like the documentation recomends.

Thanks in advance!

These errors are showing in the log:
mautic.NOTICE: PHP Notice - Undefined index: uid - in file /html/mautic-new/docroot/app/bundles/LeadBundle/Helper/TokenHelper.php - at line 87

1 Like

I would appreciate any input or info here, any bit of information could be helpfull.

Thanks in advance

The issue you are experiencing with the empty response and the PHP Notice in Mautic can be addressed as follows:

Empty Response Issue:

To troubleshoot why the company custom fields are not being sent successfully to the external API, you can perform the following steps:

  • Verify API Endpoint: Ensure that the API endpoint you are sending the webhook to is correctly configured to receive and process the company custom fields. Check the API documentation or contact the API provider for any specific requirements or limitations.

  • Check Webhook Configuration: Double-check the configuration of the webhook in Mautic. Make sure you are including the company custom fields in the payload and that they are correctly mapped to the corresponding fields in the API.

  • Review Field Mapping: Verify that the company custom fields in Mautic are properly mapped to the corresponding fields in the external API. Check for any inconsistencies or errors in the mapping configuration.

  • Test with Different Data: Try sending the webhook with different company data, including custom fields, to see if the issue persists. This can help identify if the problem lies with specific data or if it is a broader configuration issue.

  • Debug the API: If possible, review the logs or error messages on the API side to see if any errors or issues are reported during the webhook request. This can provide valuable insights into why the response is empty.

PHP Notice in Mautic:

The PHP Notice you mentioned regarding the undefined index ‘uid’ in the TokenHelper.php file can be resolved by following these steps:

  • Clear the Mautic cache to ensure that any outdated or conflicting data is removed. This can be done through the Mautic UI or by running the appropriate command, depending on your Mautic installation.

  • Verify Code Customizations: If you have made any customizations to Mautic or its codebase, review the changes and ensure they are not causing conflicts or introducing errors. If necessary, revert the changes and check if the PHP Notice still occurs.

This is a known issue:

1 Like

Hey Joey,
thanks for your answer.

Is this bug fixed in Mautic 5? I think i can wait the last ~9 days to its official alpha release :slight_smile:

Hi, it’s still open. To be fixed
It’s a good thing, that there is a bug report created, so the right eyes are on the issue.
On the side note: plz don’t use the alpha in production :smiley: