Mailchimp API 2.0 lists / subscribes with a response with an error of 250 List_MergeFieldRequired MMERGE4 required

I try to use the lists / subscribe endpoint of the Mailchimp API 2.0 to subscribe to the email in the list, but I keep puzzling the error. My query looks like this:

{
    "apikey":"myapikey-us5",
    "id":"listid",
    "email":{"email":"my@email.com"},
    "double_optin":false,
    "send_welcome":true
}

I post this on https://us5.api.mailchimp.com/2.0/lists/subscribe.jsonand get this answer:

{
    "status": "error",
    "code": 250,
    "name": "List_MergeFieldRequired",
    "error": "MMERGE4 must be provided - Please enter a value"
}

And if I point out "merge_vars": {}, I still get the same error. What am I missing here?

+4
source share
1 answer

This means that you need to specify a value for the MMERGE4 join field. How you do this depends on the type of the MMERGE4 merge field, but it will be like this:

{
    "apikey":"myapikey-us5",
    "id":"listid",
    "email":{"email":"my@email.com"},
    "double_optin":false,
    "send_welcome":true,
    "merge_vars": {
        "MMERGE4": "something"
    }
}

, , , .

+1

Source: https://habr.com/ru/post/1584088/


All Articles