• Resolved Jairo Ochoa

    (@jairoochoa)


    Hi

    I’m getting this message in a website where it used to work fine.

    I’ve noticed this bug because I’ve just configured a new website and I realized that only EMAIL, FNAME and LNAME was stored in Mailchimp.
    So I checked the other website, where it used to work, and I realized that it fails too, but even worse because this one do not register any data in MC.

    Here you have the error log:

    [2022-04-13 17:13:17] ERROR: Contact Form 7 > Mailchimp API Error: Bad Request. Invalid Resource. Your merge fields were invalid.
    - COUNTRY : Please enter a value
    Request:
    POST https://us2.api.mailchimp.com/3.0/lists/xxxxxxxxxx/members
    {"status":"pending","email_address":"doma***@do*****.es","interests":{},"merge_fields":{"FNAME":"John","LNAME":"Doe"},"email_type":"html","ip_signup":"88.44.99.11","tags":[]}
    Response:
    400 Bad Request
    {"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"Invalid Resource","status":400,"detail":"Your merge fields were invalid.","instance":"xxxxxxxx-xxxx-xxxx-xxx-xxxxxxxxxxx","errors":[{"field":"COUNTRY","message":"Please enter a value"}]}
    

    It’s a bit strange because it says “Please enter a value” but no field was empty. In fact all data is received by email. The email which sends CF7.

    So I wonder what can it be wrong.

    I did my checklist:
    – API and Audience ID are correct
    – Plugin shows all Audiences and I could also renew the list
    – CF7 form has all needed form items (as I’ve said, the old site used to work and forms were not modified)

    What else can I check ?

    Many thanks in advance.

    Regards.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Lap

    (@lapzor)

    The important bit of the error is:

    – COUNTRY : Please enter a value

    It means that in the Mailchimp audience field settings, the Country field is set to be Required, but it’s not send in with this form submission.

    See https://www.mc4wp.com/kb/fix-the-oops-something-went-wrong-error/

    Hope that helps. If you have any questions, please let me know!

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi

    I’m afraid not. As I’ve said…

    It’s a bit strange because it says “Please enter a value” but no field was empty. In fact all data is received by email. The email which sends CF7.

    I get the email which sends CF7 and the COUNTRY value is included in the email.

    That’s why I did start the topic.
    It’s quite strange.

    Thanks

    Plugin Contributor Lap

    (@lapzor)

    For MC4WP to recognize the CF7 fields needs to be sent to Mailchimp it needs to be named “mc4wp-COUNTRY” as fieldname.

    Hope that helps. If you have any questions, please let me know!

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi

    It’s new for me that it should be named “mc4wp-COUNTRY”.
    In fact I would say it used to work (years ago) If simply name it as “COUNTRY”.
    “EMAIL”, “FNAME” and “LNAME” work indeed.
    On Monday I’ll try your suggestion.
    Many thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘ERROR: Contact Form 7 > Mailchimp API Error: Bad Request. Invalid Resource.’ is closed to new replies.