1

I am using the Mailchimp API to add a new member.

I have defined a custom merge field called ADDED which is the date I added this member to the list. I want this field to be required when submitting it via the API. I defined it as DD/MM/YYYY format (see below):

enter image description here

This is what my json string looks like:

{
    "email_address":"email@server.com", 
    "status":"subscribed", 
    "merge_fields": 
         {"USERLEVEL":"1", "BATCH":"999000", "ADDED":"21/04/2020"}
}

As you can see, my format is indeed `dd/mm/yyyy', but when submitting the API request, I get this error message:

**Your merge fields were invalid: Please enter the date**

{"type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",
"title":"Invalid Resource","status":400,
"detail":"Your merge fields were invalid.",
"instance":"1ad6bc0e-7728-45c1-a308-b751247efb5b",
"errors":[{"field":"ADDED","message":"Please enter the date"}]}

Can anyone explain why I am getting this error, when I do seem to have the correctly formatted date in the request?

Thanks.

Community
  • 1
  • 1
kneidels
  • 956
  • 6
  • 29
  • 55

1 Answers1

1

OK, it seems that the definition of the field as DD/MM/YYYY might only be for reading purposes. but for submitting, it must be done like this:

"ADDED":"2020-04-21T00:00:00.001Z"

kneidels
  • 956
  • 6
  • 29
  • 55